diff --git a/.ci-config/getNewAmendments.js b/.ci-config/getNewAmendments.js index ca4690c5..3ea681f5 100644 --- a/.ci-config/getNewAmendments.js +++ b/.ci-config/getNewAmendments.js @@ -1,4 +1,4 @@ -const xrpl = require("xrpl"); +const xahau = require("xahau"); const fs = require("fs"); const path = require("path"); @@ -12,7 +12,7 @@ const amendmentsToIgnore = [ ]; async function main() { - const client = new xrpl.Client(networkToEmulate); + const client = new xahau.Client(networkToEmulate); await client.connect(); // Looks up what amendments have been enabled via their hash diff --git a/.ci-config/xahaud.cfg b/.ci-config/xahaud.cfg index 5c963ca5..91bbf9f7 100644 --- a/.ci-config/xahaud.cfg +++ b/.ci-config/xahaud.cfg @@ -98,7 +98,7 @@ r.ripple.com 51235 # 3. Click on each amendment to get their Amendment ID and name to add to this list manually. # You will likely update the list with all amendments from a new release of rippled all at once. -# To get the list of amendments on a network (e.g. devnet) follow the steps in xrpl.js's CONTRIBUTING.md for "Updating the Docker container". +# To get the list of amendments on a network (e.g. devnet) follow the steps in xahau.js's CONTRIBUTING.md for "Updating the Docker container". # https://github.com/Xahau/xahau.js/blob/main/CONTRIBUTING.md # (Running the script `getNewAmendments.js` should help you identify any new amendments that should be added.) # diff --git a/packages/isomorphic/package.json b/packages/isomorphic/package.json index 43848833..eb569c2d 100644 --- a/packages/isomorphic/package.json +++ b/packages/isomorphic/package.json @@ -1,7 +1,7 @@ { "name": "@xrplf/isomorphic", "version": "1.0.1", - "description": "A collection of isomorphic and tree-shakeable crypto hashes and utils for xrpl.js", + "description": "A collection of isomorphic and tree-shakeable crypto hashes and utils for xahau.js", "keywords": [ "crypto", "isomorphic", diff --git a/packages/xahau-binary-codec/src/enums/xahau-definitions-base.ts b/packages/xahau-binary-codec/src/enums/xahau-definitions-base.ts index c271391c..4fe302ba 100644 --- a/packages/xahau-binary-codec/src/enums/xahau-definitions-base.ts +++ b/packages/xahau-binary-codec/src/enums/xahau-definitions-base.ts @@ -91,7 +91,7 @@ class XrplDefinitionsBase { * Associates each Field to a corresponding class that TypeScript can recognize. * * @param types a list of type objects with the same name as the fields defined. - * Defaults to xrpl.js's core type definitions. + * Defaults to xahau.js's core type definitions. */ public associateTypes(types: Record): void { // Overwrite any existing type definitions with the given types diff --git a/packages/xahau/karma.config.js b/packages/xahau/karma.config.js index 41db67a3..8d1994b9 100644 --- a/packages/xahau/karma.config.js +++ b/packages/xahau/karma.config.js @@ -7,7 +7,7 @@ module.exports = function (config) { webpack: webpackConfig, // list of files / patterns to load in the browser - files: ['build/xrpl-latest.js', 'test/integration/**/*.test.ts'], + files: ['build/xahau-latest.js', 'test/integration/**/*.test.ts'], }) baseKarmaConfig(config) diff --git a/packages/xahau/package.json b/packages/xahau/package.json index 43b65ba5..858340aa 100644 --- a/packages/xahau/package.json +++ b/packages/xahau/package.json @@ -4,16 +4,16 @@ "license": "ISC", "description": "A TypeScript/JavaScript API for interacting with the XAH Ledger in Node.js and the browser", "files": [ - "build/xrpl-latest-min.js", - "build/xrpl-latest-min.js.map", - "build/xrpl-latest.js", - "build/xrpl-latest.js.map", + "build/xahau-latest-min.js", + "build/xahau-latest-min.js.map", + "build/xahau-latest.js", + "build/xahau-latest.js.map", "dist/npm/*", "src/*" ], "main": "dist/npm/", - "unpkg": "build/xrpl-latest-min.js", - "jsdelivr": "build/xrpl-latest-min.js", + "unpkg": "build/xahau-latest-min.js", + "jsdelivr": "build/xahau-latest-min.js", "types": "dist/npm/index.d.ts", "directories": { "test": "test" @@ -57,8 +57,8 @@ "analyze": "webpack --analyze", "watch": "run-s build:lib --watch", "clean": "rm -rf ./dist ./coverage ./test/testCompiledForWeb tsconfig.build.tsbuildinfo", - "docgen": "tsc --build tsconfig.docs.json && typedoc && echo js.xrpl.org >> ../../docs/CNAME", - "prepare": "copyfiles ../../README.md xrpl/README.md", + "docgen": "tsc --build tsconfig.docs.json && typedoc && echo js.xahau.org >> ../../docs/CNAME", + "prepare": "copyfiles ../../README.md xahau/README.md", "prepublish": "run-s clean build", "test": "jest --config=jest.config.unit.js --verbose false --silent=false", "test:integration": "TS_NODE_PROJECT=tsconfig.build.json jest --config=jest.config.integration.js --verbose false --silent=false --runInBand", diff --git a/packages/xahau/src/Wallet/fundWallet.ts b/packages/xahau/src/Wallet/fundWallet.ts index 71c2d07b..d5b91e2e 100644 --- a/packages/xahau/src/Wallet/fundWallet.ts +++ b/packages/xahau/src/Wallet/fundWallet.ts @@ -63,7 +63,7 @@ export interface FaucetRequestBody { usageContext?: string /** * Information about the context of where the faucet is being called from. - * Ex: xrpl.js or xrpl-py + * Ex: xahau.js or xahau-py */ userAgent: string } @@ -110,7 +110,7 @@ export interface FundWalletOptions { /** * - * Helper function to request funding from a faucet. Should not be called directly from outside the xrpl.js library. + * Helper function to request funding from a faucet. Should not be called directly from outside the xahau.js library. * * @param options - See below * @param options.faucetHost - A custom host for a faucet server. On devnet, diff --git a/packages/xahau/src/Wallet/index.ts b/packages/xahau/src/Wallet/index.ts index 7db08607..77d63230 100644 --- a/packages/xahau/src/Wallet/index.ts +++ b/packages/xahau/src/Wallet/index.ts @@ -135,7 +135,7 @@ export class Wallet { * * @example * ```ts - * const { Wallet } = require('xah') + * const { Wallet } = require('xahau') * const wallet = Wallet.generate() * ``` * @@ -320,7 +320,7 @@ export class Wallet { * @example * * ```ts - * const { Client, Wallet } = require('xah') + * const { Client, Wallet } = require('xahau') * const client = new Client('wss://xahau-test.net') * * async function signTransaction() { diff --git a/packages/xahau/src/client/index.ts b/packages/xahau/src/client/index.ts index a8fcc8e8..bb982e15 100644 --- a/packages/xahau/src/client/index.ts +++ b/packages/xahau/src/client/index.ts @@ -505,7 +505,7 @@ class Client extends EventEmitter { * @returns void * @example * ```ts - * const { Client } = require('xah') + * const { Client } = require('xahau') * const client = new Client('wss://xahau-test.net') * await client.getServerInfo() * console.log(client.networkID) @@ -533,7 +533,7 @@ class Client extends EventEmitter { * Client.connect() establishes a connection between a Client object and the server. * * ```ts - * const { Client } = require('xah') + * const { Client } = require('xahau') * const client = new Client('wss://xahau-test.net') * await client.connect() * // do something with the client @@ -546,7 +546,7 @@ class Client extends EventEmitter { * * @example * ```ts - * const { Client } = require('xah') + * const { Client } = require('xahau') * const client = new Client('wss://xahau-test.net') * await client.connect() * // do something with the client @@ -570,7 +570,7 @@ class Client extends EventEmitter { * To use the disconnect() method, you first need to create a new Client object and connect it to a server: * * ```ts - * const { Client } = require('xah') + * const { Client } = require('xahau') * const client = new Client('wss://xahau-test.net') * await client.connect() * // do something with the client @@ -595,7 +595,7 @@ class Client extends EventEmitter { * @category Network * @example * ```ts - * const { Client } = require('xah') + * const { Client } = require('xahau') * const client = new Client('wss://xahau-test.net') * await client.connect() * console.log(client.isConnected()) @@ -620,7 +620,7 @@ class Client extends EventEmitter { * @example * * ```ts - * const { Client } = require('xah') + * const { Client } = require('xahau') * * const client = new Client('wss://xahau-test.net') * @@ -705,7 +705,7 @@ class Client extends EventEmitter { * * @example * ```ts - * const { Client, Wallet } = require('xah') + * const { Client, Wallet } = require('xahau') * const client = new Client('wss://xahau-test.net') * await client.connect() * const wallet = Wallet.generate() @@ -744,7 +744,7 @@ class Client extends EventEmitter { * @example * * ```ts - * const { Client, Wallet } = require('xah') + * const { Client, Wallet } = require('xahau') * const client = new Client('wss://xahau-test.net') * * async function submitTransaction() { @@ -884,7 +884,7 @@ class Client extends EventEmitter { * * @example * ```ts - * const { Client } = require('xah') + * const { Client } = require('xahau') * const client = new Client('wss://xahau-test.net') * await client.connect() * @@ -895,7 +895,7 @@ class Client extends EventEmitter { * limit: 10 * }; * - * const balances = await xrplClient.getBalances(address, options); + * const balances = await xahauClient.getBalances(address, options); * * console.log('Account Balances:'); * balances.forEach((balance) => { @@ -1045,7 +1045,7 @@ class Client extends EventEmitter { * * @example * ```ts - * const { Client } = require('xah') + * const { Client } = require('xahau') * const client = new Client('wss://xahau-test.net') * await client.connect() * const ledgerIndex = await client.getLedgerIndex() @@ -1070,7 +1070,7 @@ class Client extends EventEmitter { * @example * * Example 1: Fund a randomly generated wallet - * const { Client, Wallet } = require('xah') + * const { Client, Wallet } = require('xahau') * * const client = new Client('wss://xahau-test.net') * await client.connect() @@ -1081,7 +1081,7 @@ class Client extends EventEmitter { * Along with the Wallet object to track the keys for that account. If you'd like, you can also re-fill an existing * Account by passing in a Wallet you already have. * ```ts - * const api = new xrpl.Client("wss://xahau-test.net") + * const api = new xahau.Client("wss://xahau-test.net") * await api.connect() * const { wallet, balance } = await api.fundWallet() * ``` diff --git a/packages/xahau/src/errors.ts b/packages/xahau/src/errors.ts index 973bea98..f7cd86cb 100644 --- a/packages/xahau/src/errors.ts +++ b/packages/xahau/src/errors.ts @@ -1,6 +1,6 @@ /* eslint-disable max-classes-per-file -- Errors can be defined in the same file */ /** - * Base Error class for xrpl.js. All Errors thrown by xrpl.js should throw + * Base Error class for xahau.js. All Errors thrown by xahau.js should throw * XahlErrors. * * @category Errors @@ -62,28 +62,28 @@ class XahlError extends Error { class XahaudError extends XahlError {} /** - * Error thrown when xrpl.js cannot specify error type. + * Error thrown when xahau.js cannot specify error type. * * @category Errors */ class UnexpectedError extends XahlError {} /** - * Error thrown when xrpl.js has an error with connection to xahaud. + * Error thrown when xahau.js has an error with connection to xahaud. * * @category Errors */ class ConnectionError extends XahlError {} /** - * Error thrown when xrpl.js is not connected to xahaud server. + * Error thrown when xahau.js is not connected to xahaud server. * * @category Errors */ class NotConnectedError extends ConnectionError {} /** - * Error thrown when xrpl.js has disconnected from xahaud server. + * Error thrown when xahau.js has disconnected from xahaud server. * * @category Errors */ @@ -97,21 +97,21 @@ class DisconnectedError extends ConnectionError {} class XahaudNotInitializedError extends ConnectionError {} /** - * Error thrown when xrpl.js times out. + * Error thrown when xahau.js times out. * * @category Errors */ class TimeoutError extends ConnectionError {} /** - * Error thrown when xrpl.js sees a response in the wrong format. + * Error thrown when xahau.js sees a response in the wrong format. * * @category Errors */ class ResponseFormatError extends ConnectionError {} /** - * Error thrown when xrpl.js sees a malformed transaction. + * Error thrown when xahau.js sees a malformed transaction. * * @category Errors */ @@ -127,7 +127,7 @@ class ValidationError extends XahlError {} class XRPLFaucetError extends XahlError {} /** - * Error thrown when xrpl.js cannot retrieve a transaction, ledger, account, etc. + * Error thrown when xahau.js cannot retrieve a transaction, ledger, account, etc. * From xahaud. * * @category Errors diff --git a/packages/xahau/src/models/methods/baseMethod.ts b/packages/xahau/src/models/methods/baseMethod.ts index c9e83145..424b140d 100644 --- a/packages/xahau/src/models/methods/baseMethod.ts +++ b/packages/xahau/src/models/methods/baseMethod.ts @@ -41,7 +41,7 @@ export interface BaseResponse { } /** - * The shape of an error response from xahaud. xrpl.js handles rejections by + * The shape of an error response from xahaud. xahau.js handles rejections by * throwing, and allowing the user to handle in the catch block of a promise. * * @category Responses diff --git a/packages/xahau/test/integration/README.md b/packages/xahau/test/integration/README.md index e4bdec3e..eae613b0 100644 --- a/packages/xahau/test/integration/README.md +++ b/packages/xahau/test/integration/README.md @@ -1,6 +1,6 @@ To run integration tests: 1. Run rippled in standalone node, either in a docker container (preferred) or by installing rippled. - * Go to the top-level of the `xrpl.js` repo, just above the `packages` folder. + * Go to the top-level of the `xahau.js` repo, just above the `packages` folder. * With docker, run `docker run -p 6006:6006 --interactive -t --volume $PWD/.ci-config:/opt/ripple/etc/ --platform linux/amd64 rippleci/rippled:2.2.0-b3 /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg` * Or [download and build rippled](https://xrpl.org/install-rippled.html) and run `./rippled -a --start` * If you'd like to use the latest rippled amendments, you should modify your `rippled.cfg` file to enable amendments in the `[amendments]` section. You can view `.ci-config/rippled.cfg` in the top level folder as an example of this. diff --git a/packages/xahau/test/integration/utils.ts b/packages/xahau/test/integration/utils.ts index ba01acd6..cdf0255a 100644 --- a/packages/xahau/test/integration/utils.ts +++ b/packages/xahau/test/integration/utils.ts @@ -221,7 +221,7 @@ export async function verifySubmittedTransaction( * @param client - The XAHL client * @param transaction - The transaction object to send. * @param wallet - The wallet to send the transaction from. - * @param retry - As of Sep 2022, xrpl.js does not track requests sent in parallel. Our sequence numbers can get off from + * @param retry - As of Sep 2022, xahau.js does not track requests sent in parallel. Our sequence numbers can get off from * the server's sequence numbers. This is a fix to retry the transaction if it fails due to tefPAST_SEQ. * @param retry.count - How many times the request should be retried. * @param retry.delayMs - How long to wait between retries. diff --git a/packages/xahau/webpack.base.config.js b/packages/xahau/webpack.base.config.js index 251dad36..be5bcc9b 100644 --- a/packages/xahau/webpack.base.config.js +++ b/packages/xahau/webpack.base.config.js @@ -7,8 +7,8 @@ module.exports = merge(getDefaultConfiguration(), { entry: './dist/npm/index.js', // overriding the output path and filename output: { - library: 'xah', + library: 'xahau', path: path.join(__dirname, 'build/'), - filename: `xrpl.default.js`, - } + filename: `xahau.default.js`, + }, }) diff --git a/packages/xahau/webpack.config.js b/packages/xahau/webpack.config.js index dc87cafd..5011298c 100644 --- a/packages/xahau/webpack.config.js +++ b/packages/xahau/webpack.config.js @@ -3,6 +3,6 @@ const { merge } = require('webpack-merge') const { getDefaultConfiguration, wrapForEnv } = require('../../webpack.config') module.exports = wrapForEnv( - 'xah', + 'xahau', merge(getDefaultConfiguration(), require('./webpack.base.config')), )