xrpl 2.0.0 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +5 -138
  2. package/build/xrpl-latest-min.js +1 -1
  3. package/build/xrpl-latest.js +1933 -1933
  4. package/dist/npm/Wallet/fundWallet.d.ts +4 -5
  5. package/dist/npm/Wallet/fundWallet.d.ts.map +1 -1
  6. package/dist/npm/Wallet/fundWallet.js.map +1 -1
  7. package/dist/npm/Wallet/index.d.ts +20 -21
  8. package/dist/npm/Wallet/index.d.ts.map +1 -1
  9. package/dist/npm/Wallet/index.js.map +1 -1
  10. package/dist/npm/claimPayChannel.d.ts +2 -0
  11. package/dist/npm/claimPayChannel.d.ts.map +1 -0
  12. package/dist/npm/claimPayChannel.js +57 -0
  13. package/dist/npm/claimPayChannel.js.map +1 -0
  14. package/dist/npm/client/BroadcastClient.d.ts.map +1 -1
  15. package/dist/npm/client/BroadcastClient.js.map +1 -1
  16. package/dist/npm/getTransaction.d.ts +2 -0
  17. package/dist/npm/getTransaction.d.ts.map +1 -0
  18. package/dist/npm/getTransaction.js +41 -0
  19. package/dist/npm/getTransaction.js.map +1 -0
  20. package/dist/npm/index.d.ts +1 -1
  21. package/dist/npm/index.d.ts.map +1 -1
  22. package/dist/npm/index.js.map +1 -1
  23. package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
  24. package/dist/npm/models/ledger/AccountRoot.js.map +1 -1
  25. package/dist/npm/models/ledger/index.d.ts +2 -2
  26. package/dist/npm/models/ledger/index.d.ts.map +1 -1
  27. package/dist/npm/models/ledger/index.js.map +1 -1
  28. package/dist/npm/models/methods/index.d.ts +3 -3
  29. package/dist/npm/models/methods/index.d.ts.map +1 -1
  30. package/dist/npm/models/methods/pathFind.d.ts +3 -3
  31. package/dist/npm/models/methods/pathFind.d.ts.map +1 -1
  32. package/dist/npm/partialPayment.d.ts +2 -0
  33. package/dist/npm/partialPayment.d.ts.map +1 -0
  34. package/dist/npm/partialPayment.js +74 -0
  35. package/dist/npm/partialPayment.js.map +1 -0
  36. package/dist/npm/paths.d.ts +2 -0
  37. package/dist/npm/paths.d.ts.map +1 -0
  38. package/dist/npm/paths.js +53 -0
  39. package/dist/npm/paths.js.map +1 -0
  40. package/dist/npm/reliableTransactionSubmission.d.ts +2 -0
  41. package/dist/npm/reliableTransactionSubmission.d.ts.map +1 -0
  42. package/dist/npm/reliableTransactionSubmission.js +42 -0
  43. package/dist/npm/reliableTransactionSubmission.js.map +1 -0
  44. package/dist/npm/sendEscrow.d.ts +2 -0
  45. package/dist/npm/sendEscrow.d.ts.map +1 -0
  46. package/dist/npm/sendEscrow.js +56 -0
  47. package/dist/npm/sendEscrow.js.map +1 -0
  48. package/dist/npm/setRegularKey.d.ts +2 -0
  49. package/dist/npm/setRegularKey.d.ts.map +1 -0
  50. package/dist/npm/setRegularKey.js +51 -0
  51. package/dist/npm/setRegularKey.js.map +1 -0
  52. package/dist/npm/sugar/balances.d.ts +8 -11
  53. package/dist/npm/sugar/balances.d.ts.map +1 -1
  54. package/dist/npm/sugar/balances.js.map +1 -1
  55. package/dist/npm/sugar/getOrderbook.d.ts +5 -7
  56. package/dist/npm/sugar/getOrderbook.d.ts.map +1 -1
  57. package/dist/npm/sugar/getOrderbook.js.map +1 -1
  58. package/dist/npm/sugar/submit.d.ts +7 -4
  59. package/dist/npm/sugar/submit.d.ts.map +1 -1
  60. package/dist/npm/sugar/submit.js +1 -1
  61. package/dist/npm/sugar/submit.js.map +1 -1
  62. package/dist/npm/utils/derive.d.ts +2 -3
  63. package/dist/npm/utils/derive.d.ts.map +1 -1
  64. package/dist/npm/utils/derive.js.map +1 -1
  65. package/dist/npm/utils/getBalanceChanges.d.ts +7 -10
  66. package/dist/npm/utils/getBalanceChanges.d.ts.map +1 -1
  67. package/dist/npm/utils/getBalanceChanges.js.map +1 -1
  68. package/dist/npm/utils/hashes/hashLedger.d.ts +3 -4
  69. package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
  70. package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
  71. package/package.json +10 -53
package/README.md CHANGED
@@ -1,141 +1,8 @@
1
1
  # xrpl.js
2
2
 
3
- A JavaScript/TypeScript library for interacting with the XRP Ledger
3
+ This package includes the `xrpl` library. This repository uses a monorepo
4
+ layout. Please find the README for `xrpl` [here](https://github.com/XRPLF/xrpl.js/tree/main/README.md).
4
5
 
5
- [![NPM](https://nodei.co/npm/xrpl.png)](https://www.npmjs.org/package/xrpl)
6
- ![npm bundle size](https://img.shields.io/bundlephobia/min/xrpl)
7
-
8
- 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.
9
-
10
- ## [➡️ Reference Documentation](http://js.xrpl.org)
11
-
12
- See the full reference documentation for all classes, methods, and utilities.
13
-
14
- ## [➡️ Applications and Projects](https://github.com/XRPLF/xrpl.js/blob/master/APPLICATIONS.md)
15
-
16
- What is `xrpl.js` used for? The applications on the list linked above use `xrpl.js`. Open a PR to add your app or project to the list!
17
-
18
- ### Features
19
-
20
- + Works in Node.js and in web browsers
21
- + Helpers for creating requests and parsing responses for the [XRP Ledger APIs](https://xrpl.org/rippled-api.html)
22
- + Listen to events on the XRP Ledger (transactions, ledger, validations, etc.)
23
- + Sign and submit transactions to the XRP Ledger
24
- + Type definitions for TypeScript
25
-
26
- ### Requirements
27
-
28
- + **[Node.js v14](https://nodejs.org/)** is recommended. We also support v12 and v16. Other versions may work but are not frequently tested.
29
- + **[npm](https://www.npmjs.com/)** is recommended. `yarn` may work but we use `package-lock.json`.
30
-
31
- ## Getting Started
32
-
33
- In an existing project (with `package.json`), install `xrpl.js`:
34
-
35
- ```
36
- $ npm install xrpl
37
- ```
38
-
39
- Example usage:
40
-
41
- ```js
42
- const xrpl = require("xrpl")
43
- async function main() {
44
- const client = new xrpl.Client("https://s.altnet.rippletest.net:51234/")
45
- await client.connect()
46
-
47
- const response = await client.request({
48
- "command": "account_info",
49
- "account": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
50
- "ledger_index": "validated"
51
- })
52
- console.log(response)
53
-
54
- client.disconnect()
55
- }
56
- main()
57
- ```
58
-
59
- For more examples, see the [documentation](#documentation).
60
-
61
- ### Using xrpl.js with React Native
62
-
63
- If you want to use `xrpl.js` with React Native you will need to install shims for core NodeJS modules. To help with this you can use a module like [rn-nodeify](https://github.com/tradle/rn-nodeify).
64
-
65
- 1. Install dependencies (you can use `yarn` as well):
66
-
67
- ```shell
68
- npm install react-native-crypto
69
- npm install xrpl
70
- # install peer deps
71
- npm install react-native-randombytes
72
- # install latest rn-nodeify
73
- npm install rn-nodeify@latest --dev
74
- ```
75
-
76
- 2. After that, run the following command:
77
-
78
- ```shell
79
- # install node core shims and recursively hack package.json files
80
- # in ./node_modules to add/update the "browser"/"react-native" field with relevant mappings
81
- ./node_modules/.bin/rn-nodeify --hack --install
82
- ```
83
-
84
- 3. Enable `crypto`:
85
-
86
- `rn-nodeify` will create a `shim.js` file in the project root directory.
87
- Open it and uncomment the line that requires the crypto module:
88
-
89
- ```javascript
90
- // If using the crypto shim, uncomment the following line to ensure
91
- // crypto is loaded first, so it can populate global.crypto
92
- require('crypto')
93
- ```
94
-
95
- 4. Import `shim` in your project (it must be the first line):
96
-
97
- ```javascript
98
- import './shim'
99
- ...
100
- ```
101
-
102
- ### Using xrpl.js with Deno
103
-
104
- Until official support for [Deno](https://deno.land) is added, you can use the following work-around to use `xrpl.js` with Deno:
105
-
106
- ```javascript
107
- import xrpl from 'https://dev.jspm.io/npm:xrpl';
108
-
109
- (async () => {
110
- const api = new (xrpl as any).Client('wss://s.altnet.rippletest.net:51233');
111
- const address = 'rH8NxV12EuV...khfJ5uw9kT';
112
-
113
- api.connect().then(() => {
114
- api.getBalances(address).then((balances: any) => {
115
- console.log(JSON.stringify(balances, null, 2));
116
- });
117
- });
118
- })();
119
- ```
120
-
121
- ## Documentation
122
-
123
- + [Get Started in Node.js](https://xrpl.org/get-started-using-node-js.html)
124
- + [Full Reference Documentation](https://js.xrpl.org)
125
- + [Code Samples](https://github.com/XRPLF/xrpl.js/tree/develop/snippets/src)
126
-
127
- ### Mailing Lists
128
-
129
- We have a low-traffic mailing list for announcements of new `xrpl.js` releases. (About 1 email per week)
130
-
131
- + [Subscribe to xrpl-announce](https://groups.google.com/g/xrpl-announce)
132
-
133
- If you're using the XRP Ledger in production, you should run a [rippled server](https://github.com/ripple/rippled) and subscribe to the ripple-server mailing list as well.
134
-
135
- + [Subscribe to ripple-server](https://groups.google.com/g/ripple-server)
136
-
137
- ## More Information
138
-
139
- + [xrpl-announce mailing list](https://groups.google.com/g/xrpl-announce) - subscribe for release announcements
140
- + [xrpl.js API Reference](https://js.xrpl.org)
141
- + [XRP Ledger Dev Portal](https://xrpl.org)
6
+ READMEs for other packages in this monorepo are located at the root of their
7
+ package, but since newcomers to XRPL are likely to want to use the `xrpl`
8
+ package this README is at the root of the project.