Skip to content

Commit

Permalink
Fix error TS2307: Cannot find module
Browse files Browse the repository at this point in the history
  • Loading branch information
intelliot committed Aug 11, 2018
1 parent 2438295 commit 7cd5172
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import * as transactionUtils from './transaction/utils'
import * as schemaValidator from './common/schema-validator'
import {getServerInfo, getFee} from './common/serverinfo'
import {clamp} from './ledger/utils'
import {Instructions} from './transaction/types'
import {Instructions, Prepare} from './transaction/types'

export type APIOptions = {
server?: string,
Expand Down Expand Up @@ -205,7 +205,8 @@ class RippleAPI extends EventEmitter {
*
* You can later submit the transaction with `submit()`.
*/
async prepareTransaction(txJSON: object, instructions: Instructions = {}) {
async prepareTransaction(txJSON: object, instructions: Instructions = {}):
Promise<Prepare> {
return transactionUtils.prepareTransaction(txJSON, this, instructions)
}

Expand Down
8 changes: 4 additions & 4 deletions src/transaction/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export type Instructions = {
export type Prepare = {
txJSON: string,
instructions: {
fee: string,
sequence: number,
maxLedgerVersion?: number
}
fee: string,
sequence: number,
maxLedgerVersion?: number
}
}

export type Submit = {
Expand Down

1 comment on commit 7cd5172

@intelliot
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a TypeScript error similar to the following:

node_modules/ripple-lib/dist/npm/api.d.ts:96:85 - error TS2307: Cannot find module '../../../../../Users/user/ripple/ripple-lib/src/transaction/types'.

96     prepareTransaction(txJSON: object, instructions?: Instructions): Promise<import("../../../../../Users/user/ripple/ripple-lib/src/transaction/types").Prepare>;

Please sign in to comment.