ripple-lib | JavaScript API for interacting with the XRP Ledger | REST library
kandi X-RAY | ripple-lib Summary
kandi X-RAY | ripple-lib Summary
A JavaScript/TypeScript API for interacting with the XRP Ledger. This is the recommended library for integrating a JavaScript/TypeScript app with the XRP Ledger, especially if you intend to use advanced functionality such as IOUs, payment paths, the decentralized exchange, account settings, payment channels, escrows, multi-signing, and more. See the full reference documentation on the XRP Ledger Dev Portal.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ripple-lib
ripple-lib Key Features
ripple-lib Examples and Code Snippets
Community Discussions
Trending Discussions on ripple-lib
QUESTION
I'm trying to create a paper wallet using the official Ripple Api, ripple-lib.
The generateAddress() accepts some parameters.
...ANSWER
Answered 2018-Sep-15 at 19:47For paper wallet what you need is only address(public) and secret(private):
https://github.com/Bithomp/xrp-paper-wallet
Actually, only secret would be enough, as you can get an address from the secret.
https://github.com/Bithomp/bithomp-tools
In Ripple you not have to use a new account for each new order/user. For each new transaction you can use a destination tag. That's how you can identify customer/order. Ripple also supports a key rotation, so if master key got exposed you can disable it and use a regular key. In best practices you assign a regular key and use it to sign transactions online, and master key always offline. If a regular key got exposed, you can replace it with a new regular key.
In ripple you can sign transactions with a keypair (public key + private key), or with the secret.
you can get keypairs for ripple here https://iancoleman.io/bip39/
ripple-lib's generateAddress()
gives you:
1) a ripple address (your public address) starts with r
you can share it, it can be used to send you payments. You can search for the public address in the explorer.
for example: https://bithomp.com/explorer/r9fVvKgMMPkBHQ3n28sifxi22zKphwkf8u
2) a secret - a master key, which will be used to sign transactions.
3) You can also assign a regular key (https://developers.ripple.com/assign-a-regular-key-pair.html)
Options has only two parameters:
algorithm string, The digital signature algorithm to generate an address for. Can be ecdsa-secp256k1 (default) or ed25519.
entropy array\integer, The entropy to use to generate the seed.
hope it helps..
QUESTION
Dear stackoverflowers,
i'm having troubles with crypto in nativescript. I want to use a NPM package ripple-lib but found no luck with nativescript-nodeify. How can I make this package work with nativescript vuejs. I Need te make use of the crypto package aswell.
EDIT: If i require the package I first get an error -> Error is: Cannot find module '/Users/koenpaas/Websites/repo/tests/FirebaseVuejs/platforms/ios/FirebaseVuejs/app/tns_modules/nativescript-nodeify/patch-npm-packages.js'.
than if i rebuild there is no error and the package is still giving me the same error as i ran it without nativescript-nodeify:
CONSOLE ERROR file:///app/bundle.js:950:22: TypeError: crypto.randomBytes is not a function. (In 'crypto.randomBytes(16)', 'crypto.randomBytes' is undefined)
...ANSWER
Answered 2019-Jan-05 at 23:51ripple-lib is using certain dependencies, that use node.js specific or globally available modules and access them via require
or directly from global
context. In reality, NativeScript environment is different from both node.js and browser, so we have to make sure all dependencies are met and are available to run in {N} environment.
For many use-cases nativescript-nodeify plugin does the job, but case of using ripple-lib
, it does not resolve the issue so we have to take care of compatibilities manually:
1) ripple-lib
's dependency bignumber.js is using native node library crypto. Since it is not available in {N} runtime, we have to use specially designed module nativescript-randombytes and make it accessible globally with webpack's providePlugin:
Add NativeScript plugin to the project:
QUESTION
I can't send Ripple XRP using ripple-lib and rippled server.
If I submit with signed payment object, then UnhandledPromiseRejectionWarning: DisconnectedError: not opened
error shows up.
This is my code:
...ANSWER
Answered 2018-Apr-20 at 10:02I think you should return the promise at
QUESTION
New to concept of callbacks and promises. I'm trying to read contents of a directory which is correctly returning the addresses but this code is only printing console.log(value) and the console.log in the function getAccount "gettin info..." but nowhere printing the balance the api is getting closed and the process completes, I dont understand this because the address is being passed and the first console.log is printing inside the function but not doing further job. when i remove the fs.readdir and files.foreach and pass a single value to getAccount its working perfectly fine. No errors or bugs , its a runtime error and im guessing related to callbacks
...ANSWER
Answered 2018-Jan-20 at 21:58You really don't want to mix asynchronous operations that return a promise with those that take a direct callback. It's hard to write good robust code when mixing like that. So, since you are already using with promises in a number of operations, it's best to take the remaining async operations and "promisify" them so you can use them with promises. Then, you can take advantage of all the clean error propagation and chaining of promises.
Then, secondly, you have to make sure all your asynchronous operations in a loop are properly chained to the parent promise. To do that here, we will accumulate the promises from getAccount()
in the loop into an array of promises. Then, after the loop, we can tell when they're all done using Promise.all()
and then return that promise from readdir()
so that they will all be properly chained to the parent promise.
This will then make sure everything inside the loop finishes before the parent resolves and before you call api.disconnect()
.
Here's what that would look like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ripple-lib
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page