xahau-patch

This commit is contained in:
Denis Angell
2025-03-12 13:34:24 +01:00
parent 92eb809397
commit 9544e1794e
958 changed files with 1686 additions and 169992 deletions

View File

@@ -1,31 +1,31 @@
# Unique Setup Steps for Xrpl.js
# Unique Setup Steps for Xahau.js
Starting in 3.0 xrpl and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xahau and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
### Using xrpl.js from a CDN
### Using xahau.js from a CDN
You can avoid setting up your build system to handle `xrpl.js` by using a cdn version that is prebuilt for the browser.
You can avoid setting up your build system to handle `xahau.js` by using a cdn version that is prebuilt for the browser.
- unpkg `<script src="https://unpkg.com/xrpl@2.3.0/build/xrpl-latest-min.js"></script>`
- jsdelivr `<script src="https://cdn.jsdelivr.net/npm/xrpl@2.3.0/build/xrpl-latest-min.js"></script>`
- unpkg `<script src="https://unpkg.com/xahau@2.3.0/build/xahau-latest-min.js"></script>`
- jsdelivr `<script src="https://cdn.jsdelivr.net/npm/xahau@2.3.0/build/xahau-latest-min.js"></script>`
Ensure that the full path is provided so the browser can find the sourcemaps.
### Using xrpl.js with `create-react-app`
### Using xahau.js with `create-react-app`
Starting in 3.0 xrpl and its related packages no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xahau and its related packages no longer require custom configurations (ex. polyfills) to run.
This online template uses these steps to run xrpl.js with React in the browser:
https://codesandbox.io/s/xrpl-intro-pxgdjr?file=/src/App.js
This online template uses these steps to run xahau.js with React in the browser:
https://codesandbox.io/s/xahau-intro-pxgdjr?file=/src/App.js
### Using xrpl.js with React Native
### Using xahau.js with React Native
If you want to use `xrpl.js` with React Native you will need to install polyfills for core NodeJS modules.
If you want to use `xahau.js` with React Native you will need to install polyfills for core NodeJS modules.
1. Install dependencies (you can use `yarn` as well):
```shell
npm install xrpl \
npm install xahau \
fast-text-encoding \
react-native-get-random-values
```
@@ -53,23 +53,23 @@ import './polyfills'
...
```
### Using xrpl.js with Vite React
### Using xahau.js with Vite React
Starting in 3.0 xrpl and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xahau and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
### Using xrpl.js with Deno
### Using xahau.js with Deno
Until official support for [Deno](https://deno.land) is added, you can use the following work-around to use `xrpl.js` with Deno:
Until official support for [Deno](https://deno.land) is added, you can use the following work-around to use `xahau.js` with Deno:
> [!NOTE]
> The following is currently broken due to https://github.com/denoland/deno/issues/20516.
> Once that is fixed there could be other issues as well.
```javascript
import xrpl from 'https://dev.jspm.io/npm:xrpl';
import xahau from 'https://dev.jspm.io/npm:xahau';
(async () => {
const api = new (xrpl as any).Client('wss://s.altnet.rippletest.net:51233');
const api = new (xahau as any).Client('wss://xahau-test.net');
const address = 'rH8NxV12EuV...khfJ5uw9kT';
api.connect().then(() => {