mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-04-29 15:37:50 +00:00
build: makes connection private
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "xrpl",
|
||||
"version": "2.0.0-beta.0",
|
||||
"version": "2.0.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "xrpl",
|
||||
"version": "2.0.0-beta.0",
|
||||
"version": "2.0.0-beta.1",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@types/lodash": "^4.14.136",
|
||||
|
||||
@@ -164,7 +164,7 @@ const MAX_LIMIT = 400
|
||||
class Client extends EventEmitter {
|
||||
// New in > 0.21.0
|
||||
// non-validated ledger versions are allowed, and passed to rippled as-is.
|
||||
public readonly connection: Connection
|
||||
private readonly connection: Connection
|
||||
|
||||
// Factor to multiply estimated fee by to provide a cushion in case the
|
||||
// required fee rises during submission of a transaction. Defaults to 1.2.
|
||||
@@ -241,6 +241,15 @@ class Client extends EventEmitter {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL of the server the Client is connected to.
|
||||
*
|
||||
* @returns The URL of the rippled server this Client is connected to.
|
||||
*/
|
||||
public get url(): string {
|
||||
return this.connection.getUrl()
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there are more pages of data.
|
||||
*
|
||||
|
||||
@@ -281,7 +281,7 @@ async function hasAddressBalanceIncreased(
|
||||
* @returns A {@link FaucetNetwork}.
|
||||
*/
|
||||
function getFaucetUrl(client: Client): FaucetNetwork | undefined {
|
||||
const connectionUrl = client.connection.getUrl()
|
||||
const connectionUrl = client.url
|
||||
|
||||
// 'altnet' for Ripple Testnet server and 'testnet' for XRPL Labs Testnet server
|
||||
if (connectionUrl.includes('altnet') || connectionUrl.includes('testnet')) {
|
||||
|
||||
@@ -25,8 +25,7 @@ describe('Client', function () {
|
||||
|
||||
it('Client valid options', function () {
|
||||
const client = new Client('wss://s:1')
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: fix when src/client linting is merged
|
||||
const privateConnectionUrl = (client.connection as any).url
|
||||
const privateConnectionUrl = client.url
|
||||
assert.deepEqual(privateConnectionUrl, 'wss://s:1')
|
||||
})
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ describe('client constructor', function () {
|
||||
|
||||
it('Client valid options', function () {
|
||||
const client = new Client('wss://s:1')
|
||||
const privateConnectionUrl = client.connection.getUrl()
|
||||
const privateConnectionUrl = client.url
|
||||
assert.deepEqual(privateConnectionUrl, 'wss://s:1')
|
||||
})
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ const masterSecret = 'snoPBrXtMeMyMHUVTgbuqAfg1SUTb'
|
||||
|
||||
export async function ledgerAccept(client: Client): Promise<void> {
|
||||
const request = { command: 'ledger_accept' }
|
||||
await client.connection.request(request)
|
||||
await client.request(request)
|
||||
}
|
||||
|
||||
export async function fundAccount(
|
||||
|
||||
@@ -12,7 +12,7 @@ async function setupClient(this: any, port = defaultPort): Promise<void> {
|
||||
return tclient
|
||||
.connect()
|
||||
.then(async () => {
|
||||
return tclient.connection.request({
|
||||
return tclient.request({
|
||||
command: 'test_command',
|
||||
data: { openOnOtherPort: true },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user