diff --git a/packages/xrpl/src/models/transactions/import.ts b/packages/xrpl/src/models/transactions/import.ts new file mode 100644 index 00000000..bd78155c --- /dev/null +++ b/packages/xrpl/src/models/transactions/import.ts @@ -0,0 +1,24 @@ +import { BaseTransaction, validateBaseTransaction } from './common' + +/** + * + * + * @category Transaction Models + */ +export interface Import extends BaseTransaction { + TransactionType: 'Import' + /** + * Hex value representing a VL Blob. + */ + Blob?: string +} + +/** + * Verify the form and type of an Import at runtime. + * + * @param tx - An Import Transaction. + * @throws When the Import is Malformed. + */ +export function validateImport(tx: Record): void { + validateBaseTransaction(tx) +} diff --git a/packages/xrpl/src/models/transactions/index.ts b/packages/xrpl/src/models/transactions/index.ts index a05db998..5ef1c800 100644 --- a/packages/xrpl/src/models/transactions/index.ts +++ b/packages/xrpl/src/models/transactions/index.ts @@ -14,6 +14,7 @@ export { DepositPreauth } from './depositPreauth' export { EscrowCancel } from './escrowCancel' export { EscrowCreate } from './escrowCreate' export { EscrowFinish } from './escrowFinish' +export { Import } from './import' export { Invoke } from './invoke' export { NFTokenAcceptOffer } from './NFTokenAcceptOffer' export { NFTokenBurn } from './NFTokenBurn' diff --git a/packages/xrpl/src/models/transactions/transaction.ts b/packages/xrpl/src/models/transactions/transaction.ts index 19361c84..93ba43bc 100644 --- a/packages/xrpl/src/models/transactions/transaction.ts +++ b/packages/xrpl/src/models/transactions/transaction.ts @@ -13,6 +13,7 @@ import { DepositPreauth, validateDepositPreauth } from './depositPreauth' import { EscrowCancel, validateEscrowCancel } from './escrowCancel' import { EscrowCreate, validateEscrowCreate } from './escrowCreate' import { EscrowFinish, validateEscrowFinish } from './escrowFinish' +import { Import, validateImport } from './import' import { Invoke, validateInvoke } from './invoke' import { TransactionMetadata } from './metadata' import { @@ -63,6 +64,7 @@ export type Transaction = | EscrowCancel | EscrowCreate | EscrowFinish + | Import | Invoke | NFTokenAcceptOffer | NFTokenBurn @@ -144,6 +146,10 @@ export function validate(transaction: Record): void { validateEscrowFinish(tx) break + case 'Import': + validateImport(tx) + break + case 'Invoke': validateInvoke(tx) break