mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 12:45:50 +00:00
Revert "Expose validation methods in public api"
This reverts commit 9e9a0a7d9b.
We should move methods like deriveKeypair and deriveAddress
off of the schemaValidator object.
This commit is contained in:
@@ -109,7 +109,8 @@ class RippleAPI extends EventEmitter {
|
|||||||
static _PRIVATE = {
|
static _PRIVATE = {
|
||||||
validate,
|
validate,
|
||||||
RangeSet,
|
RangeSet,
|
||||||
ledgerUtils
|
ledgerUtils,
|
||||||
|
schemaValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(options: APIOptions = {}) {
|
constructor(options: APIOptions = {}) {
|
||||||
@@ -328,8 +329,6 @@ class RippleAPI extends EventEmitter {
|
|||||||
dropsToXrp = dropsToXrp
|
dropsToXrp = dropsToXrp
|
||||||
iso8601ToRippleTime = iso8601ToRippleTime
|
iso8601ToRippleTime = iso8601ToRippleTime
|
||||||
txFlags = txFlags
|
txFlags = txFlags
|
||||||
|
|
||||||
static schemaValidator = schemaValidator
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as assert from 'assert'
|
|||||||
const {Validator} = require('jsonschema')
|
const {Validator} = require('jsonschema')
|
||||||
import {ValidationError} from './errors'
|
import {ValidationError} from './errors'
|
||||||
import {isValidAddress} from 'ripple-address-codec'
|
import {isValidAddress} from 'ripple-address-codec'
|
||||||
import {isValidSecret,deriveKeypair,deriveAddress} from './utils'
|
import {isValidSecret} from './utils'
|
||||||
|
|
||||||
function loadSchemas() {
|
function loadSchemas() {
|
||||||
// listed explicitly for webpack (instead of scanning schemas directory)
|
// listed explicitly for webpack (instead of scanning schemas directory)
|
||||||
@@ -158,8 +158,5 @@ function schemaValidate(schemaName: string, object: any): void {
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
schemaValidate,
|
schemaValidate,
|
||||||
isValidAddress,
|
isValidSecret
|
||||||
isValidSecret,
|
|
||||||
deriveKeypair,
|
|
||||||
deriveAddress
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as _ from 'lodash'
|
import * as _ from 'lodash'
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import {deriveKeypair,deriveAddress} from 'ripple-keypairs'
|
import {deriveKeypair} from 'ripple-keypairs'
|
||||||
import {Amount, RippledAmount} from './types/objects'
|
import {Amount, RippledAmount} from './types/objects'
|
||||||
import {ValidationError} from './errors'
|
import {ValidationError} from './errors'
|
||||||
|
|
||||||
@@ -155,8 +155,6 @@ export {
|
|||||||
removeUndefined,
|
removeUndefined,
|
||||||
rippleTimeToISO8601,
|
rippleTimeToISO8601,
|
||||||
iso8601ToRippleTime,
|
iso8601ToRippleTime,
|
||||||
isValidSecret,
|
isValidSecret
|
||||||
deriveKeypair,
|
|
||||||
deriveAddress
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const hashes = require('./fixtures/hashes');
|
|||||||
const address = addresses.ACCOUNT;
|
const address = addresses.ACCOUNT;
|
||||||
const utils = RippleAPI._PRIVATE.ledgerUtils;
|
const utils = RippleAPI._PRIVATE.ledgerUtils;
|
||||||
const ledgerClosed = require('./fixtures/rippled/ledger-close-newer');
|
const ledgerClosed = require('./fixtures/rippled/ledger-close-newer');
|
||||||
const schemaValidator = RippleAPI.schemaValidator;
|
const schemaValidator = RippleAPI._PRIVATE.schemaValidator;
|
||||||
const binary = require('ripple-binary-codec');
|
const binary = require('ripple-binary-codec');
|
||||||
const BigNumber = require('bignumber.js')
|
const BigNumber = require('bignumber.js')
|
||||||
assert.options.strict = true;
|
assert.options.strict = true;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const setupAPI = require('./setup-api');
|
|||||||
const responses = require('./fixtures').responses;
|
const responses = require('./fixtures').responses;
|
||||||
const ledgerClosed = require('./fixtures/rippled/ledger-close');
|
const ledgerClosed = require('./fixtures/rippled/ledger-close');
|
||||||
const RippleAPI = require('ripple-api').RippleAPI;
|
const RippleAPI = require('ripple-api').RippleAPI;
|
||||||
const schemaValidator = RippleAPI.schemaValidator;
|
const schemaValidator = RippleAPI._PRIVATE.schemaValidator;
|
||||||
|
|
||||||
const TIMEOUT = process.browser ? 25000 : 10000;
|
const TIMEOUT = process.browser ? 25000 : 10000;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user