mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
refactor: move everything out of the common folder (#1629)
* remove common/constants (all in models now) * remove common/txFlags (all in models now) * move ecdsa from src/common to src * move errors from src/common to src, export at top level
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
NotConnectedError,
|
||||
ConnectionError,
|
||||
XrplError,
|
||||
} from '../common/errors'
|
||||
} from '../errors'
|
||||
import { BaseRequest } from '../models/methods/baseMethod'
|
||||
|
||||
import ExponentialBackoff from './backoff'
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
import * as assert from 'assert'
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
import * as constants from '../common/constants'
|
||||
import { ValidationError, XrplError } from '../common/errors'
|
||||
import * as errors from '../common/errors'
|
||||
import { txFlags } from '../common/txflags'
|
||||
import { ValidationError, XrplError } from '../errors'
|
||||
import * as errors from '../errors'
|
||||
import {
|
||||
// account methods
|
||||
AccountChannelsRequest,
|
||||
@@ -538,11 +536,6 @@ class Client extends EventEmitter {
|
||||
public generateFaucetWallet = prepend(generateFaucetWallet, this)
|
||||
|
||||
public errors = errors
|
||||
|
||||
public txFlags = txFlags
|
||||
public static txFlags = txFlags
|
||||
public accountSetFlags = constants.AccountSetFlags
|
||||
public static accountSetFlags = constants.AccountSetFlags
|
||||
}
|
||||
|
||||
export { Client, Connection }
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
ResponseFormatError,
|
||||
RippledError,
|
||||
TimeoutError,
|
||||
} from '../common/errors'
|
||||
import { ResponseFormatError, RippledError, TimeoutError } from '../errors'
|
||||
import { Response } from '../models/methods'
|
||||
import { BaseRequest, ErrorResponse } from '../models/methods/baseMethod'
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
import { txFlagIndices } from './txflags'
|
||||
|
||||
// Ordering from https://developers.ripple.com/accountroot.html
|
||||
const accountRootFlags = {
|
||||
// lsfDefaultRipple:
|
||||
// Enable rippling on trust lines by default.
|
||||
// Required for issuing addresses; discouraged for others.
|
||||
DefaultRipple: 0x00800000,
|
||||
|
||||
// lsfDepositAuth:
|
||||
// Require account to auth deposits.
|
||||
// This account can only receive funds from transactions it sends,
|
||||
// or preauthorized accounts.
|
||||
DepositAuth: 0x01000000,
|
||||
|
||||
// lsfDisableMaster:
|
||||
// Force regular key.
|
||||
// Disallows use of the master key.
|
||||
DisableMaster: 0x00100000,
|
||||
|
||||
// lsfDisallowXRP:
|
||||
// Disallow sending XRP.
|
||||
// Not enforced by rippled; client applications should check.
|
||||
DisallowXRP: 0x00080000,
|
||||
|
||||
// lsfGlobalFreeze:
|
||||
// Trustlines globally frozen.
|
||||
GlobalFreeze: 0x00400000,
|
||||
|
||||
// lsfNoFreeze:
|
||||
// Permanently disallowed freezing trustlines.
|
||||
// Once enabled, cannot be disabled.
|
||||
NoFreeze: 0x00200000,
|
||||
|
||||
// lsfPasswordSpent:
|
||||
// Password set fee is spent.
|
||||
// The account has used its free SetRegularKey transaction.
|
||||
PasswordSpent: 0x00010000,
|
||||
|
||||
// lsfRequireAuth:
|
||||
// Require authorization to hold IOUs (issuances).
|
||||
RequireAuth: 0x00040000,
|
||||
|
||||
// lsfRequireDestTag:
|
||||
// Require a DestinationTag for incoming payments.
|
||||
RequireDestTag: 0x00020000,
|
||||
}
|
||||
|
||||
const AccountFlags = {
|
||||
passwordSpent: accountRootFlags.PasswordSpent,
|
||||
requireDestinationTag: accountRootFlags.RequireDestTag,
|
||||
requireAuthorization: accountRootFlags.RequireAuth,
|
||||
depositAuth: accountRootFlags.DepositAuth,
|
||||
disallowIncomingXRP: accountRootFlags.DisallowXRP,
|
||||
disableMasterKey: accountRootFlags.DisableMaster,
|
||||
noFreeze: accountRootFlags.NoFreeze,
|
||||
globalFreeze: accountRootFlags.GlobalFreeze,
|
||||
defaultRipple: accountRootFlags.DefaultRipple,
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
passwordSpent?: boolean
|
||||
requireDestinationTag?: boolean
|
||||
requireAuthorization?: boolean
|
||||
depositAuth?: boolean
|
||||
disallowIncomingXRP?: boolean
|
||||
disableMasterKey?: boolean
|
||||
noFreeze?: boolean
|
||||
globalFreeze?: boolean
|
||||
defaultRipple?: boolean
|
||||
}
|
||||
|
||||
const AccountSetFlags = {
|
||||
requireDestinationTag: txFlagIndices.AccountSet.asfRequireDest,
|
||||
requireAuthorization: txFlagIndices.AccountSet.asfRequireAuth,
|
||||
depositAuth: txFlagIndices.AccountSet.asfDepositAuth,
|
||||
disallowIncomingXRP: txFlagIndices.AccountSet.asfDisallowXRP,
|
||||
disableMasterKey: txFlagIndices.AccountSet.asfDisableMaster,
|
||||
enableTransactionIDTracking: txFlagIndices.AccountSet.asfAccountTxnID,
|
||||
noFreeze: txFlagIndices.AccountSet.asfNoFreeze,
|
||||
globalFreeze: txFlagIndices.AccountSet.asfGlobalFreeze,
|
||||
defaultRipple: txFlagIndices.AccountSet.asfDefaultRipple,
|
||||
}
|
||||
|
||||
const AccountFields = {
|
||||
EmailHash: {
|
||||
name: 'emailHash',
|
||||
encoding: 'hex',
|
||||
length: 32,
|
||||
defaults: '00000000000000000000000000000000',
|
||||
},
|
||||
WalletLocator: { name: 'walletLocator' },
|
||||
MessageKey: { name: 'messageKey' },
|
||||
Domain: { name: 'domain', encoding: 'hex' },
|
||||
TransferRate: { name: 'transferRate', defaults: 0, shift: 9 },
|
||||
TickSize: { name: 'tickSize', defaults: 0 },
|
||||
}
|
||||
|
||||
export { AccountFields, AccountSetFlags, AccountFlags }
|
||||
@@ -1,61 +0,0 @@
|
||||
const txFlags = {
|
||||
// Universal flags can apply to any transaction type
|
||||
Universal: {
|
||||
FullyCanonicalSig: 0x80000000,
|
||||
},
|
||||
|
||||
AccountSet: {
|
||||
RequireDestTag: 0x00010000,
|
||||
OptionalDestTag: 0x00020000,
|
||||
RequireAuth: 0x00040000,
|
||||
OptionalAuth: 0x00080000,
|
||||
DisallowXRP: 0x00100000,
|
||||
AllowXRP: 0x00200000,
|
||||
},
|
||||
|
||||
TrustSet: {
|
||||
SetAuth: 0x00010000,
|
||||
NoRipple: 0x00020000,
|
||||
SetNoRipple: 0x00020000,
|
||||
ClearNoRipple: 0x00040000,
|
||||
SetFreeze: 0x00100000,
|
||||
ClearFreeze: 0x00200000,
|
||||
},
|
||||
|
||||
OfferCreate: {
|
||||
Passive: 0x00010000,
|
||||
ImmediateOrCancel: 0x00020000,
|
||||
FillOrKill: 0x00040000,
|
||||
Sell: 0x00080000,
|
||||
},
|
||||
|
||||
Payment: {
|
||||
NoRippleDirect: 0x00010000,
|
||||
PartialPayment: 0x00020000,
|
||||
LimitQuality: 0x00040000,
|
||||
},
|
||||
|
||||
PaymentChannelClaim: {
|
||||
Renew: 0x00010000,
|
||||
Close: 0x00020000,
|
||||
},
|
||||
}
|
||||
|
||||
// The following are integer (as opposed to bit) flags
|
||||
// that can be set for particular transactions in the
|
||||
// SetFlag or ClearFlag field
|
||||
const txFlagIndices = {
|
||||
AccountSet: {
|
||||
asfRequireDest: 1,
|
||||
asfRequireAuth: 2,
|
||||
asfDisallowXRP: 3,
|
||||
asfDisableMaster: 4,
|
||||
asfAccountTxnID: 5,
|
||||
asfNoFreeze: 6,
|
||||
asfGlobalFreeze: 7,
|
||||
asfDefaultRipple: 8,
|
||||
asfDepositAuth: 9,
|
||||
},
|
||||
}
|
||||
|
||||
export { txFlags, txFlagIndices }
|
||||
@@ -9,4 +9,6 @@ export * from './models/transactions'
|
||||
|
||||
export * from './utils'
|
||||
|
||||
export * from './errors'
|
||||
|
||||
export { default as Wallet } from './wallet'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable complexity -- Necessary for validateAccountSet */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable complexity -- Necessary for validateCheckCash */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount } from '../common'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction, isAmount } from './common'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable complexity -- Necessary for validateCheckCreate */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount } from '../common'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable max-lines-per-function -- Necessary for validateBaseTransaction */
|
||||
/* eslint-disable complexity -- Necessary for validateBaseTransaction */
|
||||
/* eslint-disable max-statements -- Necessary for validateBaseTransaction */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Memo, Signer } from '../common'
|
||||
import { onlyHasFields } from '../utils'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable complexity -- Necessary for validateDepositPreauth */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable complexity -- Necessary for validateEscrowCreate */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable complexity -- Necessary for validateOfferCreate */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount } from '../common'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable max-statements -- Necessary for validatePayment */
|
||||
/* eslint-disable complexity -- Necessary for validatePayment */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount, Path } from '../common'
|
||||
import { isFlagEnabled } from '../utils'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable complexity -- Necessary for validatePaymentChannelClaim */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, GlobalFlags, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable complexity -- Necessary for validatePaymentChannelCreate */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import { SignerEntry } from '../common'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
|
||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import _ from 'lodash'
|
||||
import { encode, decode } from 'ripple-binary-codec'
|
||||
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import { setTransactionFlagsToNumber } from '../utils'
|
||||
|
||||
import { AccountDelete, validateAccountDelete } from './accountDelete'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount } from '../common'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-param-reassign -- param reassign is safe */
|
||||
/* eslint-disable no-bitwise -- flags require bitwise operations */
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
// eslint-disable-next-line import/no-cycle -- cycle is safe
|
||||
import {
|
||||
AccountSetFlagsInterface,
|
||||
|
||||
@@ -2,7 +2,7 @@ import BigNumber from 'bignumber.js'
|
||||
import { xAddressToClassicAddress, isValidXAddress } from 'ripple-address-codec'
|
||||
|
||||
import type { Client } from '..'
|
||||
import { ValidationError } from '../common/errors'
|
||||
import { ValidationError } from '../errors'
|
||||
import { AccountInfoRequest, LedgerRequest } from '../models/methods'
|
||||
import { Transaction } from '../models/transactions'
|
||||
import { setTransactionFlagsToNumber } from '../models/utils'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { decode, encode } from 'ripple-binary-codec'
|
||||
|
||||
import type { Client, SubmitRequest, SubmitResponse, Wallet } from '..'
|
||||
import { ValidationError } from '../common/errors'
|
||||
import { ValidationError } from '../errors'
|
||||
import { Transaction } from '../models/transactions'
|
||||
import { sign } from '../wallet/signer'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { decodeAccountID } from 'ripple-address-codec'
|
||||
import binary from 'ripple-binary-codec'
|
||||
import { JsonObject } from 'ripple-binary-codec/dist/types/serialized-type'
|
||||
|
||||
import { ValidationError } from '../common/errors'
|
||||
import { ValidationError } from '../errors'
|
||||
import { computeSignedTransactionHash } from '../utils/hashes'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { classicAddressToXAddress } from 'ripple-address-codec'
|
||||
import keypairs from 'ripple-keypairs'
|
||||
|
||||
import ECDSA from '../common/ecdsa'
|
||||
import { UnexpectedError } from '../common/errors'
|
||||
import ECDSA from '../ecdsa'
|
||||
import { UnexpectedError } from '../errors'
|
||||
|
||||
export interface GeneratedAddress {
|
||||
xAddress: string
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import BigNumber from 'bignumber.js'
|
||||
import { decode, encode } from 'ripple-binary-codec'
|
||||
|
||||
import { ValidationError } from '../../common/errors'
|
||||
import { ValidationError } from '../../errors'
|
||||
import type { Ledger } from '../../models/ledger'
|
||||
import { LedgerEntry } from '../../models/ledger'
|
||||
import { Transaction } from '../../models/transactions'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import BigNumber from 'bignumber.js'
|
||||
|
||||
import { ValidationError } from '../common/errors'
|
||||
import { ValidationError } from '../errors'
|
||||
|
||||
const DROPS_PER_XRP = 1000000.0
|
||||
const MAX_FRACTION_LENGTH = 6
|
||||
|
||||
@@ -4,7 +4,7 @@ import { request as httpsRequest, RequestOptions } from 'https'
|
||||
import { isValidClassicAddress } from 'ripple-address-codec'
|
||||
|
||||
import type { Client } from '..'
|
||||
import { RippledError, XRPLFaucetError } from '../common/errors'
|
||||
import { RippledError, XRPLFaucetError } from '../errors'
|
||||
import { GeneratedAddress } from '../utils/generateAddress'
|
||||
|
||||
import Wallet from '.'
|
||||
|
||||
@@ -20,8 +20,8 @@ import {
|
||||
sign,
|
||||
} from 'ripple-keypairs'
|
||||
|
||||
import ECDSA from '../common/ecdsa'
|
||||
import { ValidationError } from '../common/errors'
|
||||
import ECDSA from '../ecdsa'
|
||||
import { ValidationError } from '../errors'
|
||||
import { Transaction } from '../models/transactions'
|
||||
|
||||
const DEFAULT_ALGORITHM: ECDSA = ECDSA.ed25519
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from 'ripple-binary-codec'
|
||||
import { sign as signWithKeypair, verify } from 'ripple-keypairs'
|
||||
|
||||
import { ValidationError } from '../common/errors'
|
||||
import { ValidationError } from '../errors'
|
||||
import { Signer } from '../models/common'
|
||||
import { Transaction } from '../models/transactions'
|
||||
import { validateBaseTransaction } from '../models/transactions/common'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { ValidationError } from 'xrpl-local'
|
||||
import { Transaction } from 'xrpl-local/models/transactions'
|
||||
|
||||
import rippled from '../fixtures/rippled'
|
||||
|
||||
@@ -3,17 +3,16 @@ import net from 'net'
|
||||
import { assert } from 'chai'
|
||||
import _ from 'lodash'
|
||||
|
||||
import { Client } from 'xrpl-local'
|
||||
import { Connection } from 'xrpl-local/client'
|
||||
|
||||
import {
|
||||
Client,
|
||||
ConnectionError,
|
||||
DisconnectedError,
|
||||
NotConnectedError,
|
||||
ResponseFormatError,
|
||||
XrplError,
|
||||
TimeoutError,
|
||||
} from '../src/common/errors'
|
||||
} from 'xrpl-local'
|
||||
import { Connection } from 'xrpl-local/client'
|
||||
|
||||
import rippled from './fixtures/rippled'
|
||||
import { setupClient, teardownClient } from './setupClient'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { RippledError } from '../src/common/errors'
|
||||
import { RippledError } from 'xrpl-local'
|
||||
|
||||
import { setupClient, teardownClient } from './setupClient'
|
||||
import { assertRejects } from './testUtils'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateAccountDelete, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateAccountDelete, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* AccountDelete Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateAccountSet, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateAccountSet, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* AccountSet Transaction Verification Testing.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { ValidationError } from 'xrpl-local'
|
||||
import { validateBaseTransaction } from 'xrpl-local/models/transactions/common'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateCheckCancel, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateCheckCancel, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* CheckCancel Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateCheckCash, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateCheckCash, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* CheckCash Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateCheckCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateCheckCreate, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* CheckCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateDepositPreauth, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateDepositPreauth, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* DepositPreauth Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateEscrowCancel, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateEscrowCancel, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateEscrowCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateEscrowCreate, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* EscrowCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateEscrowFinish, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateEscrowFinish, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* EscrowFinish Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateOfferCancel, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateOfferCancel, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* OfferCancel Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateOfferCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateOfferCreate, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* OfferCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validatePayment, validate, PaymentTransactionFlags } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import {
|
||||
validatePayment,
|
||||
validate,
|
||||
PaymentTransactionFlags,
|
||||
ValidationError,
|
||||
} from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* PaymentTransaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validatePaymentChannelClaim, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import {
|
||||
validatePaymentChannelClaim,
|
||||
validate,
|
||||
ValidationError,
|
||||
} from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* PaymentChannelClaim Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validatePaymentChannelCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import {
|
||||
validatePaymentChannelCreate,
|
||||
validate,
|
||||
ValidationError,
|
||||
} from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* PaymentChannelCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validatePaymentChannelFund, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import {
|
||||
validatePaymentChannelFund,
|
||||
validate,
|
||||
ValidationError,
|
||||
} from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* PaymentChannelFund Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validate, validateSetRegularKey } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validate, validateSetRegularKey, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* SetRegularKey Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validate, validateSignerListSet } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validate, validateSignerListSet, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* SignerListSet Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateTicketCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateTicketCreate, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* TicketCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateTrustSet, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateTrustSet, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* TrustSet Transaction Verification Testing.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { ValidationError, XrplError } from '../../src/common/errors'
|
||||
import { ValidationError, XrplError } from 'xrpl-local'
|
||||
import { computeLedgerHash } from '../../src/utils'
|
||||
import requests from '../fixtures/requests'
|
||||
import responses from '../fixtures/responses'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import ECDSA from '../../src/common/ecdsa'
|
||||
import { UnexpectedError } from '../../src/common/errors'
|
||||
import ECDSA from '../../src/ecdsa'
|
||||
import { UnexpectedError } from 'xrpl-local'
|
||||
import {
|
||||
generateXAddress,
|
||||
GenerateAddressOptions,
|
||||
|
||||
@@ -4,8 +4,7 @@ import path from 'path'
|
||||
import { assert } from 'chai'
|
||||
import { encode } from 'ripple-binary-codec'
|
||||
|
||||
import { OfferCreate, Transaction } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { OfferCreate, Transaction, ValidationError } from 'xrpl-local'
|
||||
|
||||
import {
|
||||
computeStateTreeHash,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { assert } from 'chai'
|
||||
import { decode } from 'ripple-binary-codec/dist'
|
||||
|
||||
import ECDSA from '../../src/common/ecdsa'
|
||||
import { Transaction } from '../../src/models/transactions'
|
||||
import Wallet from '../../src/wallet'
|
||||
import { Transaction } from 'xrpl-local'
|
||||
import ECDSA from 'xrpl-local/ecdsa'
|
||||
import Wallet from 'xrpl-local/wallet'
|
||||
|
||||
import requests from '../fixtures/requests'
|
||||
import responses from '../fixtures/responses'
|
||||
|
||||
|
||||
@@ -2,16 +2,14 @@ import { assert } from 'chai'
|
||||
import { decode, encode } from 'ripple-binary-codec/dist'
|
||||
import { JsonObject } from 'ripple-binary-codec/dist/types/serialized-type'
|
||||
|
||||
import { Transaction } from 'xrpl-local'
|
||||
|
||||
import { ValidationError } from '../../src/common/errors'
|
||||
import Wallet from '../../src/wallet'
|
||||
import { Transaction, ValidationError } from 'xrpl-local'
|
||||
import Wallet from 'xrpl-local/wallet'
|
||||
import {
|
||||
sign,
|
||||
authorizeChannel,
|
||||
multisign,
|
||||
verifySignature,
|
||||
} from '../../src/wallet/signer'
|
||||
} from 'xrpl-local/wallet/signer'
|
||||
|
||||
const publicKey =
|
||||
'030E58CDD076E798C84755590AAF6237CA8FAE821070A59F648B517A30DC6F589D'
|
||||
|
||||
Reference in New Issue
Block a user