diff --git a/packages/xrpl/src/models/transactions/import.ts b/packages/xrpl/src/models/transactions/import.ts index bd78155c..fdab0460 100644 --- a/packages/xrpl/src/models/transactions/import.ts +++ b/packages/xrpl/src/models/transactions/import.ts @@ -1,3 +1,5 @@ +import { ValidationError } from '../../errors' + import { BaseTransaction, validateBaseTransaction } from './common' /** @@ -7,6 +9,10 @@ import { BaseTransaction, validateBaseTransaction } from './common' */ export interface Import extends BaseTransaction { TransactionType: 'Import' + /** + * + */ + Issuer?: string /** * Hex value representing a VL Blob. */ @@ -21,4 +27,12 @@ export interface Import extends BaseTransaction { */ export function validateImport(tx: Record): void { validateBaseTransaction(tx) + + if (tx.Issuer !== undefined && typeof tx.Issuer !== 'string') { + throw new ValidationError('Import: Issuer must be a string') + } + + if (tx.Account === tx.Issuer) { + throw new ValidationError('Import: Issuer and Account must not be equal') + } }