lint filenames (#1757)

* build: update @xrplf/typescript-style

* fix filename casing

* fix webpack setup

* add missing eslint plugin

Co-authored-by: Nathan Nichols <natenichols@cox.net>
This commit is contained in:
ledhed2222
2021-10-19 16:08:46 -04:00
committed by GitHub
parent a7c9a88bcf
commit bd154fd6e8
73 changed files with 242 additions and 162 deletions

View File

@@ -50,8 +50,6 @@ module.exports = {
'multiline-comment-style': ['error', 'starred-block'],
'jsdoc/check-examples': 'off',
// Allows the usage of @category -- TODO: try to add this in base config
'jsdoc/check-tag-names': 'off',
'tsdoc/syntax': 'off',
'jsdoc/require-description-complete-sentence': 'off',
},
@@ -103,6 +101,9 @@ module.exports = {
// setup/teardown client is easier to do in before/after, even if there is only one testcase
'mocha/no-hooks-for-single-case': 'off',
// messes with fixtures
'consistent-default-export-name/default-import-match-filename': 'off',
},
},
{

133
package-lock.json generated
View File

@@ -28,8 +28,8 @@
"@types/ws": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.0.0",
"@xrplf/eslint-config": "^1.4.0",
"@xrplf/prettier-config": "^1.2.0",
"@xrplf/eslint-config": "^1.5.0",
"@xrplf/prettier-config": "^1.5.0",
"assert": "^2.0.0",
"buffer": "^6.0.2",
"chai": "^4.3.4",
@@ -37,6 +37,7 @@
"ejs": "^3.0.1",
"eslint": "^7.5.0",
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-consistent-default-export-name": "^0.0.13",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.24.1",
"eslint-plugin-jsdoc": "^36.0.0",
@@ -1340,9 +1341,9 @@
}
},
"node_modules/@xrplf/eslint-config": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.4.0.tgz",
"integrity": "sha512-tSpFzcQinykGrmF/kFgKumtQrIkpeOwAsCCEOmJC7f2uo6soZVB4EK0GPJ+l1uYN5o35YR34cEAPz+bBodJ6sw==",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.5.0.tgz",
"integrity": "sha512-jVxkjC+kxkXXNDhDKGteqJ8Bhvrq2xwg00UTqArZTYK0VPDzEaFOgrOKgruybz7/pzY0n8Gf2HRu2tENRtRB+Q==",
"dev": true,
"dependencies": {
"confusing-browser-globals": "^1.0.9",
@@ -1350,28 +1351,29 @@
"eslint-config-prettier": "8.3.0"
},
"engines": {
"node": ">=14.15.0 <15.0.0",
"npm": ">=7.20.0 <8.0.0"
"node": ">= 14.15.0",
"npm": ">= 7.0.0 < 8.0.0"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"eslint": "^7.5.0",
"eslint-plugin-array-func": "^3.1.6",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsdoc": "36.0.8",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-tsdoc": "^0.2.5",
"prettier": "^2.0.5",
"typescript": ">=3.9.0"
"@typescript-eslint/eslint-plugin": ">= 4.30.0 < 5",
"@typescript-eslint/parser": ">= 4.30.0 < 5",
"eslint": ">= 7.5.0 < 8",
"eslint-plugin-array-func": ">= 3.1.6 < 4",
"eslint-plugin-consistent-default-export-name": ">= 0.0.13",
"eslint-plugin-eslint-comments": ">= 3.2.0 < 4",
"eslint-plugin-import": ">= 2.22.0 < 3",
"eslint-plugin-jsdoc": ">= 36.0.8 < 37",
"eslint-plugin-node": ">= 11.1.0 < 12",
"eslint-plugin-prettier": "~4.0",
"eslint-plugin-tsdoc": ">= 0.2.5",
"prettier": ">= 2.0.5 < 3",
"typescript": ">= 3.9.0"
}
},
"node_modules/@xrplf/prettier-config": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@xrplf/prettier-config/-/prettier-config-1.2.0.tgz",
"integrity": "sha512-dVGcbxcmtCRogsLYkdjczm01g+nDCtrJHQsTEWsOl+EemNGOQFCjiiorVsvg6EClkU6yxjqJOh0IqYfH/GAOfw==",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@xrplf/prettier-config/-/prettier-config-1.5.0.tgz",
"integrity": "sha512-Wq9Dw3RJMQoiKXv+sz0EPh/1j5E1fbxvBOzAAsrdltQoXgjk1ai6OIGaegKxtJPXd2P80b/H8PhRbU/DS9z5Rg==",
"dev": true
},
"node_modules/@xtuc/ieee754": {
@@ -2880,6 +2882,21 @@
"eslint": ">=3.0.0"
}
},
"node_modules/eslint-plugin-consistent-default-export-name": {
"version": "0.0.13",
"resolved": "https://registry.npmjs.org/eslint-plugin-consistent-default-export-name/-/eslint-plugin-consistent-default-export-name-0.0.13.tgz",
"integrity": "sha512-vrCH7XnvJZTTVlw8zH+4X84bK7MbI9/h4m0r7wxvYcbW4XViSDb99SBE6Wz1HmWzz3sUHID6nFeVjek5qdObRA==",
"dev": true,
"dependencies": {
"lodash.camelcase": "^4.3.0",
"lodash.kebabcase": "^4.1.1",
"lodash.snakecase": "^4.1.1",
"lodash.upperfirst": "^4.3.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/eslint-plugin-es": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz",
@@ -5095,6 +5112,12 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash.camelcase": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
"integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=",
"dev": true
},
"node_modules/lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
@@ -5107,18 +5130,36 @@
"integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=",
"dev": true
},
"node_modules/lodash.kebabcase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz",
"integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=",
"dev": true
},
"node_modules/lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
"dev": true
},
"node_modules/lodash.snakecase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz",
"integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=",
"dev": true
},
"node_modules/lodash.truncate": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
"integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=",
"dev": true
},
"node_modules/lodash.upperfirst": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz",
"integrity": "sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=",
"dev": true
},
"node_modules/log-symbols": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
@@ -9530,9 +9571,9 @@
"requires": {}
},
"@xrplf/eslint-config": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.4.0.tgz",
"integrity": "sha512-tSpFzcQinykGrmF/kFgKumtQrIkpeOwAsCCEOmJC7f2uo6soZVB4EK0GPJ+l1uYN5o35YR34cEAPz+bBodJ6sw==",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.5.0.tgz",
"integrity": "sha512-jVxkjC+kxkXXNDhDKGteqJ8Bhvrq2xwg00UTqArZTYK0VPDzEaFOgrOKgruybz7/pzY0n8Gf2HRu2tENRtRB+Q==",
"dev": true,
"requires": {
"confusing-browser-globals": "^1.0.9",
@@ -9541,9 +9582,9 @@
}
},
"@xrplf/prettier-config": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@xrplf/prettier-config/-/prettier-config-1.2.0.tgz",
"integrity": "sha512-dVGcbxcmtCRogsLYkdjczm01g+nDCtrJHQsTEWsOl+EemNGOQFCjiiorVsvg6EClkU6yxjqJOh0IqYfH/GAOfw==",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@xrplf/prettier-config/-/prettier-config-1.5.0.tgz",
"integrity": "sha512-Wq9Dw3RJMQoiKXv+sz0EPh/1j5E1fbxvBOzAAsrdltQoXgjk1ai6OIGaegKxtJPXd2P80b/H8PhRbU/DS9z5Rg==",
"dev": true
},
"@xtuc/ieee754": {
@@ -10775,6 +10816,18 @@
"dev": true,
"requires": {}
},
"eslint-plugin-consistent-default-export-name": {
"version": "0.0.13",
"resolved": "https://registry.npmjs.org/eslint-plugin-consistent-default-export-name/-/eslint-plugin-consistent-default-export-name-0.0.13.tgz",
"integrity": "sha512-vrCH7XnvJZTTVlw8zH+4X84bK7MbI9/h4m0r7wxvYcbW4XViSDb99SBE6Wz1HmWzz3sUHID6nFeVjek5qdObRA==",
"dev": true,
"requires": {
"lodash.camelcase": "^4.3.0",
"lodash.kebabcase": "^4.1.1",
"lodash.snakecase": "^4.1.1",
"lodash.upperfirst": "^4.3.1"
}
},
"eslint-plugin-es": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz",
@@ -12371,6 +12424,12 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.camelcase": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
"integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=",
"dev": true
},
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
@@ -12383,18 +12442,36 @@
"integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=",
"dev": true
},
"lodash.kebabcase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz",
"integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=",
"dev": true
},
"lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
"dev": true
},
"lodash.snakecase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz",
"integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=",
"dev": true
},
"lodash.truncate": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
"integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=",
"dev": true
},
"lodash.upperfirst": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz",
"integrity": "sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=",
"dev": true
},
"log-symbols": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",

View File

@@ -16,7 +16,7 @@
"test": "test"
},
"browser": {
"ws": "./dist/npm/client/wsWrapper.js"
"ws": "./dist/npm/client/WSWrapper.js"
},
"dependencies": {
"bignumber.js": "^9.0.0",
@@ -41,8 +41,8 @@
"@types/ws": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.0.0",
"@xrplf/eslint-config": "^1.4.0",
"@xrplf/prettier-config": "^1.2.0",
"@xrplf/eslint-config": "^1.5.0",
"@xrplf/prettier-config": "^1.5.0",
"assert": "^2.0.0",
"buffer": "^6.0.2",
"chai": "^4.3.4",
@@ -50,6 +50,7 @@
"ejs": "^3.0.1",
"eslint": "^7.5.0",
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-consistent-default-export-name": "^0.0.13",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.24.1",
"eslint-plugin-jsdoc": "^36.0.0",

View File

@@ -20,11 +20,11 @@ import {
sign,
} from 'ripple-keypairs'
import ECDSA from '../ecdsa'
import ECDSA from '../ECDSA'
import { ValidationError } from '../errors'
import { Transaction } from '../models/transactions'
import { ensureClassicAddress } from '../sugar/utils'
import { hashSignedTx } from '../utils/hashes/ledgerHash'
import { hashSignedTx } from '../utils/hashes/hashLedger'
const DEFAULT_ALGORITHM: ECDSA = ECDSA.ed25519
const DEFAULT_DERIVATION_PATH = "m/44'/144'/0'/0/0"

View File

@@ -13,9 +13,9 @@ import {
} from '../errors'
import { BaseRequest } from '../models/methods/baseMethod'
import ExponentialBackoff from './backoff'
import ConnectionManager from './connectionManager'
import RequestManager from './requestManager'
import ConnectionManager from './ConnectionManager'
import ExponentialBackoff from './ExponentialBackoff'
import RequestManager from './RequestManager'
const SECONDS_PER_MINUTE = 60
const TIMEOUT = 20

View File

@@ -94,7 +94,7 @@ import {
submit,
submitAndWait,
} from '../sugar'
import fundWallet from '../wallet/fundWallet'
import fundWallet from '../Wallet/fundWallet'
import {
Connection,

View File

@@ -10,7 +10,7 @@ import type {
} from '..'
import type { Amount } from '../models/common'
import { PaymentFlags, Transaction } from '../models/transactions'
import type TransactionMetadata from '../models/transactions/metadata'
import type { TransactionMetadata } from '../models/transactions/metadata'
import { isFlagEnabled } from '../models/utils'
const WARN_PARTIAL_PAYMENT_CODE = 2001

View File

@@ -1,5 +1,5 @@
// Broadcast client is experimental
export { default as BroadcastClient } from './client/broadcastClient'
export { default as BroadcastClient } from './client/BroadcastClient'
export { Client } from './client'
@@ -11,6 +11,6 @@ export * from './utils'
export * from './errors'
export { default as Wallet } from './wallet'
export { default as Wallet } from './Wallet'
export * from './wallet/signer'
export * from './Wallet/signer'

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The AccountRoot object type describes a single account, its settings, and

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
interface Majority {
Majority: {

View File

@@ -1,6 +1,6 @@
import { Amount } from '../common'
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* A Check object describes a check, similar to a paper personal check, which

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* A DepositPreauth object tracks a preauthorization from one account to

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The DirectoryNode object type provides a list of links to other objects in

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The Escrow object type represents a held payment of XRP waiting to be

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The FeeSettings object type contains the current base transaction cost and

View File

@@ -1,7 +1,7 @@
import { Transaction } from '../transactions'
import TransactionMetadata from '../transactions/metadata'
import { TransactionMetadata } from '../transactions/metadata'
import LedgerEntry from './ledgerEntry'
import LedgerEntry from './LedgerEntry'
/**
* A ledger is a block of transactions and shared state data. It has a unique

View File

@@ -0,0 +1,32 @@
import AccountRoot from './AccountRoot'
import Amendments from './Amendments'
import Check from './Check'
import DepositPreauth from './DepositPreauth'
import DirectoryNode from './DirectoryNode'
import Escrow from './Escrow'
import FeeSettings from './FeeSettings'
import LedgerHashes from './LedgerHashes'
import NegativeUNL from './NegativeUNL'
import Offer from './Offer'
import PayChannel from './PayChannel'
import RippleState from './RippleState'
import SignerList from './SignerList'
import Ticket from './Ticket'
type LedgerEntry =
| AccountRoot
| Amendments
| Check
| DepositPreauth
| DirectoryNode
| Escrow
| FeeSettings
| LedgerHashes
| NegativeUNL
| Offer
| PayChannel
| RippleState
| SignerList
| Ticket
export default LedgerEntry

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The LedgerHashes objects exist to make it possible to look up a previous

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
interface DisabledValidator {
FirstLedgerSequence: number

View File

@@ -1,6 +1,6 @@
import { Amount } from '../common'
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
export default interface Offer extends BaseLedgerEntry {
LedgerEntryType: 'Offer'

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The PayChannel object type represents a payment channel. Payment channels

View File

@@ -1,6 +1,6 @@
import { IssuedCurrencyAmount } from '../common'
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The RippleState object type connects two accounts in a single currency.

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
interface SignerEntry {
SignerEntry: {

View File

@@ -1,4 +1,4 @@
import BaseLedgerEntry from './baseLedgerEntry'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The Ticket object type represents a Ticket, which tracks an account sequence

View File

@@ -1,20 +1,20 @@
/* eslint-disable import/no-unused-modules -- Needs to export all ledger objects */
import AccountRoot, { AccountRootFlags } from './accountRoot'
import Amendments from './amendments'
import Check from './check'
import DepositPreauth from './depositPreauth'
import DirectoryNode from './directoryNode'
import Escrow from './escrow'
import FeeSettings from './feeSettings'
import Ledger from './ledger'
import LedgerEntry from './ledgerEntry'
import LedgerHashes from './ledgerHashes'
import NegativeUNL from './negativeUNL'
import Offer, { OfferFlags } from './offer'
import PayChannel from './payChannel'
import RippleState, { RippleStateFlags } from './rippleState'
import SignerList, { SignerListFlags } from './signerList'
import Ticket from './ticket'
import AccountRoot, { AccountRootFlags } from './AccountRoot'
import Amendments from './Amendments'
import Check from './Check'
import DepositPreauth from './DepositPreauth'
import DirectoryNode from './DirectoryNode'
import Escrow from './Escrow'
import FeeSettings from './FeeSettings'
import Ledger from './Ledger'
import LedgerEntry from './LedgerEntry'
import LedgerHashes from './LedgerHashes'
import NegativeUNL from './NegativeUNL'
import Offer, { OfferFlags } from './Offer'
import PayChannel from './PayChannel'
import RippleState, { RippleStateFlags } from './RippleState'
import SignerList, { SignerListFlags } from './SignerList'
import Ticket from './Ticket'
export {
AccountRoot,

View File

@@ -1,32 +0,0 @@
import AccountRoot from './accountRoot'
import Amendments from './amendments'
import Check from './check'
import DepositPreauth from './depositPreauth'
import DirectoryNode from './directoryNode'
import Escrow from './escrow'
import FeeSettings from './feeSettings'
import LedgerHashes from './ledgerHashes'
import NegativeUNL from './negativeUNL'
import Offer from './offer'
import PayChannel from './payChannel'
import RippleState from './rippleState'
import SignerList from './signerList'
import Ticket from './ticket'
type LedgerEntry =
| AccountRoot
| Amendments
| Check
| DepositPreauth
| DirectoryNode
| Escrow
| FeeSettings
| LedgerHashes
| NegativeUNL
| Offer
| PayChannel
| RippleState
| SignerList
| Ticket
export default LedgerEntry

View File

@@ -1,6 +1,6 @@
import { LedgerIndex } from '../common'
import { Transaction } from '../transactions'
import Metadata from '../transactions/metadata'
import { TransactionMetadata } from '../transactions/metadata'
import { BaseRequest, BaseResponse } from './baseMethod'
@@ -61,7 +61,7 @@ interface AccountTransaction {
* If binary is True, then this is a hex string of the transaction metadata.
* Otherwise, the transaction metadata is included in JSON format.
*/
meta: string | Metadata
meta: string | TransactionMetadata
/** JSON object defining the transaction. */
tx?: Transaction
/** Unique hashed String representing the transaction. */

View File

@@ -1,7 +1,7 @@
import { LedgerIndex } from '../common'
import { Ledger } from '../ledger'
import { Transaction, TransactionAndMetadata } from '../transactions'
import TransactionMetadata from '../transactions/metadata'
import { TransactionMetadata } from '../transactions/metadata'
import { BaseRequest, BaseResponse } from './baseMethod'

View File

@@ -1,7 +1,7 @@
import type { Amount, Currency, Path, StreamType } from '../common'
import { Offer } from '../ledger'
import { OfferCreate, Transaction } from '../transactions'
import TransactionMetadata from '../transactions/metadata'
import { TransactionMetadata } from '../transactions/metadata'
import type { BaseRequest, BaseResponse } from './baseMethod'

View File

@@ -1,6 +1,6 @@
import { LedgerIndex } from '../common'
import { Transaction } from '../transactions'
import TransactionMetadata from '../transactions/metadata'
import { TransactionMetadata } from '../transactions/metadata'
import { BaseRequest, BaseResponse } from './baseMethod'

View File

@@ -1,5 +1,5 @@
import { Transaction } from '../transactions'
import TransactionMetadata from '../transactions/metadata'
import { TransactionMetadata } from '../transactions/metadata'
import { BaseRequest, BaseResponse } from './baseMethod'

View File

@@ -29,7 +29,7 @@ interface DeletedNode {
export type Node = CreatedNode | ModifiedNode | DeletedNode
export default interface TransactionMetadata {
export interface TransactionMetadata {
AffectedNodes: Node[]
DeliveredAmount?: Amount
// "unavailable" possible for transactions before 2014-01-20

View File

@@ -5,7 +5,7 @@ import _ from 'lodash'
import { encode, decode } from 'ripple-binary-codec'
import { ValidationError } from '../../errors'
import setTransactionFlagsToNumber from '../utils/flags'
import { setTransactionFlagsToNumber } from '../utils/flags'
import { AccountDelete, validateAccountDelete } from './accountDelete'
import { AccountSet, validateAccountSet } from './accountSet'
@@ -16,7 +16,7 @@ import { DepositPreauth, validateDepositPreauth } from './depositPreauth'
import { EscrowCancel, validateEscrowCancel } from './escrowCancel'
import { EscrowCreate, validateEscrowCreate } from './escrowCreate'
import { EscrowFinish, validateEscrowFinish } from './escrowFinish'
import TransactionMetadata from './metadata'
import { TransactionMetadata } from './metadata'
import { OfferCancel, validateOfferCancel } from './offerCancel'
import { OfferCreate, validateOfferCreate } from './offerCreate'
import { Payment, validatePayment } from './payment'

View File

@@ -5,7 +5,7 @@ import { ValidationError } from '../../errors'
import {
AccountRootFlagsInterface,
AccountRootFlags,
} from '../ledger/accountRoot'
} from '../ledger/AccountRoot'
import {
AccountSetFlagsInterface,
AccountSetTfFlags,
@@ -51,7 +51,7 @@ export function parseAccountRootFlags(
*
* @param tx - A transaction to set its flags to its numeric representation.
*/
export default function setTransactionFlagsToNumber(tx: Transaction): void {
export function setTransactionFlagsToNumber(tx: Transaction): void {
if (tx.Flags == null) {
tx.Flags = 0
return

View File

@@ -5,10 +5,10 @@ import type { Client } from '..'
import { ValidationError, XrplError } from '../errors'
import { AccountInfoRequest, AccountObjectsRequest } from '../models/methods'
import { Transaction } from '../models/transactions'
import setTransactionFlagsToNumber from '../models/utils/flags'
import { setTransactionFlagsToNumber } from '../models/utils/flags'
import { xrpToDrops } from '../utils'
import getFeeXrp from './fee'
import getFeeXrp from './getFeeXrp'
// Expire unconfirmed transactions after 20 ledger versions, approximately 1 minute, by default
const LEDGER_OFFSET = 20

View File

@@ -4,7 +4,7 @@ import _ from 'lodash'
import type { Client } from '../client'
import { LedgerIndex } from '../models/common'
import { OfferFlags } from '../models/ledger/offer'
import { OfferFlags } from '../models/ledger/Offer'
import {
BookOffer,
BookOffersRequest,

View File

@@ -2,9 +2,9 @@ export { default as autofill } from './autofill'
export { getBalances, getXrpBalance } from './balances'
export { default as getLedgerIndex } from './ledgerIndex'
export { default as getLedgerIndex } from './getLedgerIndex'
export { default as getOrderbook } from './orderbook'
export { default as getOrderbook } from './getOrderbook'
export * from './submit'

View File

@@ -2,7 +2,7 @@ import BigNumber from 'bignumber.js'
import _ from 'lodash'
import { Amount, IssuedCurrencyAmount } from '../models/common'
import TransactionMetadata, { Node } from '../models/transactions/metadata'
import { TransactionMetadata, Node } from '../models/transactions/metadata'
import { dropsToXrp } from './xrpConversion'

View File

@@ -1,8 +1,8 @@
import { XrplError } from '../../../errors'
import hashPrefix from '../hashPrefix'
import HashPrefix from '../HashPrefix'
import sha512Half from '../sha512Half'
import Leaf from './leafNode'
import LeafNode from './LeafNode'
import { NodeType, Node } from './node'
const HEX_ZERO =
@@ -52,7 +52,7 @@ class InnerNode extends Node {
if (existingNode instanceof InnerNode) {
// There is an inner node, so we need to go deeper
existingNode.addItem(tag, node)
} else if (existingNode instanceof Leaf) {
} else if (existingNode instanceof LeafNode) {
if (existingNode.tag === tag) {
// Collision
throw new XrplError(
@@ -116,7 +116,7 @@ class InnerNode extends Node {
hex += hash
}
const prefix = hashPrefix.INNER_NODE.toString(HEX)
const prefix = HashPrefix.INNER_NODE.toString(HEX)
return sha512Half(prefix + hex)
}
}

View File

@@ -1,5 +1,5 @@
import { XrplError } from '../../../errors'
import hashPrefix from '../hashPrefix'
import HashPrefix from '../HashPrefix'
import sha512Half from '../sha512Half'
import { NodeType, Node } from './node'
@@ -9,7 +9,7 @@ const HEX = 16
/**
* Class for SHAMap Leaf Node.
*/
class Leaf extends Node {
class LeafNode extends Node {
public tag: string
public type: NodeType
public data: string
@@ -49,15 +49,15 @@ class Leaf extends Node {
public get hash(): string {
switch (this.type) {
case NodeType.ACCOUNT_STATE: {
const leafPrefix = hashPrefix.LEAF_NODE.toString(HEX)
const leafPrefix = HashPrefix.LEAF_NODE.toString(HEX)
return sha512Half(leafPrefix + this.data + this.tag)
}
case NodeType.TRANSACTION_NO_METADATA: {
const txIDPrefix = hashPrefix.TRANSACTION_ID.toString(HEX)
const txIDPrefix = HashPrefix.TRANSACTION_ID.toString(HEX)
return sha512Half(txIDPrefix + this.data)
}
case NodeType.TRANSACTION_METADATA: {
const txNodePrefix = hashPrefix.TRANSACTION_NODE.toString(HEX)
const txNodePrefix = HashPrefix.TRANSACTION_NODE.toString(HEX)
return sha512Half(txNodePrefix + this.data + this.tag)
}
default:
@@ -66,4 +66,4 @@ class Leaf extends Node {
}
}
export default Leaf
export default LeafNode

View File

@@ -1,5 +1,5 @@
import InnerNode from './innerNode'
import Leaf from './leafNode'
import InnerNode from './InnerNode'
import LeafNode from './LeafNode'
import { NodeType } from './node'
class SHAMap {
@@ -20,7 +20,7 @@ class SHAMap {
* @param type - Type of the node to add.
*/
public addItem(tag: string, data: string, type: NodeType): void {
this.root.addItem(tag, new Leaf(tag, data, type))
this.root.addItem(tag, new LeafNode(tag, data, type))
}
/**

View File

@@ -10,11 +10,11 @@ import { ValidationError, XrplError } from '../../errors'
import type { Ledger } from '../../models/ledger'
import { LedgerEntry } from '../../models/ledger'
import { Transaction } from '../../models/transactions'
import Metadata from '../../models/transactions/metadata'
import { TransactionMetadata } from '../../models/transactions/metadata'
import HashPrefix from './hashPrefix'
import HashPrefix from './HashPrefix'
import sha512Half from './sha512Half'
import SHAMap, { NodeType } from './shaMap'
import SHAMap, { NodeType } from './SHAMap'
const HEX = 16
@@ -125,7 +125,7 @@ export function hashLedgerHeader(ledgerHeader: Ledger): string {
* @category Utilities
*/
export function hashTxTree(
transactions: Array<Transaction & { metaData?: Metadata }>,
transactions: Array<Transaction & { metaData?: TransactionMetadata }>,
): string {
const shamap = new SHAMap()
for (const txJSON of transactions) {

View File

@@ -6,13 +6,13 @@
import BigNumber from 'bignumber.js'
import { decodeAccountID } from 'ripple-address-codec'
import HashPrefix from './hashPrefix'
import hashLedger, {
hashLedgerHeader,
hashSignedTx,
hashTxTree,
hashStateTree,
} from './ledgerHash'
} from './hashLedger'
import HashPrefix from './HashPrefix'
import ledgerSpaces from './ledgerSpaces'
import sha512Half from './sha512Half'

View File

@@ -21,8 +21,8 @@ import { Response } from '../models/methods'
import { PaymentChannelClaim } from '../models/transactions/paymentChannelClaim'
import { Transaction } from '../models/transactions/transaction'
import getBalanceChanges from './balanceChanges'
import { deriveKeypair, deriveXAddress } from './derive'
import getBalanceChanges from './getBalanceChanges'
import {
hashSignedTx,
hashTx,

View File

@@ -1,6 +1,6 @@
import { assert } from 'chai'
import ExponentialBackoff from '../src/client/backoff'
import ExponentialBackoff from '../src/client/ExponentialBackoff'
describe('ExponentialBackoff', function () {
it('duration() return value starts with the min value', function () {

View File

@@ -1,6 +1,6 @@
import { assert } from 'chai'
import getFeeXrp from '../../src/sugar/fee'
import getFeeXrp from '../../src/sugar/getFeeXrp'
import rippled from '../fixtures/rippled'
import { setupClient, teardownClient } from '../setupClient'

View File

@@ -3,7 +3,7 @@ import _ from 'lodash'
import { ValidationError } from 'xrpl-local'
import { Transaction } from 'xrpl-local/models/transactions'
import Wallet from 'xrpl-local/wallet'
import Wallet from 'xrpl-local/Wallet'
import rippled from '../fixtures/rippled'
import { setupClient, teardownClient } from '../setupClient'

View File

@@ -5,7 +5,7 @@ import _ from 'lodash'
import { Client } from 'xrpl-local'
import { AccountSet, SignerListSet } from 'xrpl-local/models/transactions'
import { convertStringToHex } from 'xrpl-local/utils'
import { multisign } from 'xrpl-local/wallet/signer'
import { multisign } from 'xrpl-local/Wallet/signer'
import serverUrl from './serverUrl'
import { setupClient, teardownClient } from './setup'

View File

@@ -11,7 +11,7 @@ import {
OfferCreate,
} from 'xrpl-local'
import { convertStringToHex } from 'xrpl-local/utils'
import { multisign } from 'xrpl-local/wallet/signer'
import { multisign } from 'xrpl-local/Wallet/signer'
import serverUrl from './serverUrl'
import { setupClient, teardownClient } from './setup'

View File

@@ -12,7 +12,7 @@ import {
hashes,
} from 'xrpl-local'
import { convertStringToHex } from 'xrpl-local/utils'
import { multisign } from 'xrpl-local/wallet/signer'
import { multisign } from 'xrpl-local/Wallet/signer'
import serverUrl from '../serverUrl'
import { setupClient, teardownClient } from '../setup'

View File

@@ -14,7 +14,8 @@ import {
} from 'xrpl-local'
import { AccountRootFlags } from 'xrpl-local/models/ledger'
import { isFlagEnabled } from 'xrpl-local/models/utils'
import setTransactionFlagsToNumber, {
import {
setTransactionFlagsToNumber,
parseAccountRootFlags,
} from 'xrpl-local/models/utils/flags'

View File

@@ -2,7 +2,7 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types -- Necessary for test setup */
import { Client, BroadcastClient } from 'xrpl-local'
import createMockRippled from './mockRippled'
import createMockRippled from './createMockRippled'
import { getFreePort } from './testUtils'
async function setupMockRippledConnection(

View File

@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types -- Necessary for test setup */
import { Client, BroadcastClient } from 'xrpl-local'
import { PortResponse } from './mockRippled'
import { PortResponse } from './createMockRippled'
const defaultPort = 34371
const baseUrl = 'ws://testripple.circleci.com:'

View File

@@ -1,6 +1,6 @@
import assert from 'assert'
import SHAMap, { NodeType } from '../src/utils/hashes/shaMap'
import SHAMap, { NodeType } from '../src/utils/hashes/SHAMap'
const TYPE_TRANSACTION_NO_METADATA = NodeType.TRANSACTION_NO_METADATA

View File

@@ -1,6 +1,6 @@
import { assert } from 'chai'
import { _private } from '../../src/wallet/fundWallet'
import { _private } from '../../src/Wallet/fundWallet'
import { setupClient, teardownClient } from '../setupClient'
const { FaucetNetwork, getFaucetUrl } = _private

View File

@@ -2,8 +2,8 @@ import { assert } from 'chai'
import { decode } from 'ripple-binary-codec/dist'
import { Transaction } from 'xrpl-local'
import ECDSA from 'xrpl-local/ecdsa'
import Wallet from 'xrpl-local/wallet'
import ECDSA from 'xrpl-local/ECDSA'
import Wallet from 'xrpl-local/Wallet'
import requests from '../fixtures/requests'
import responses from '../fixtures/responses'

View File

@@ -2,12 +2,12 @@ import { assert } from 'chai'
import { decode, encode } from 'ripple-binary-codec/dist'
import { Transaction, ValidationError } from 'xrpl-local'
import Wallet from 'xrpl-local/wallet'
import Wallet from 'xrpl-local/Wallet'
import {
authorizeChannel,
multisign,
verifySignature,
} from 'xrpl-local/wallet/signer'
} from 'xrpl-local/Wallet/signer'
const publicKey =
'030E58CDD076E798C84755590AAF6237CA8FAE821070A59F648B517A30DC6F589D'

View File

@@ -83,7 +83,7 @@ function webpackForTest(testFileName) {
},
resolve: {
alias: {
ws: './dist/npm/client/wsWrapper.js',
ws: './dist/npm/client/WSWrapper.js',
'https-proxy-agent': false,
},
extensions: ['.ts', '.js', '.json'],

View File

@@ -24,7 +24,7 @@ function getDefaultConfiguration() {
filename: `xrpl.default.js`,
},
plugins: [
new webpack.NormalModuleReplacementPlugin(/^ws$/, './wsWrapper'),
new webpack.NormalModuleReplacementPlugin(/^ws$/, './WSWrapper'),
new webpack.ProvidePlugin({ process: 'process/browser' }),
new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }),
new webpack.IgnorePlugin({
@@ -49,7 +49,7 @@ function getDefaultConfiguration() {
},
resolve: {
alias: {
ws: './dist/npm/client/wsWrapper.js',
ws: './dist/npm/client/WSWrapper.js',
'https-proxy-agent': false,
},
extensions: ['.js', '.json'],