mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-01 01:25:48 +00:00
fix: resolve OfferCancel merge issues (#1546)
* fix: resolve OfferCancel git issues
This commit is contained in:
committed by
Mayukha Vadari
parent
e9d0d40db5
commit
cfab859a20
@@ -1,6 +1,7 @@
|
||||
export * from './transaction'
|
||||
export * from './offerCreate'
|
||||
export * from './accountSet'
|
||||
export * from './offerCancel'
|
||||
export * from './checkCreate'
|
||||
export * from './checkCash'
|
||||
export * from './checkCancel'
|
||||
|
||||
24
src/models/transactions/offerCancel.ts
Normal file
24
src/models/transactions/offerCancel.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ValidationError } from "../../common/errors"
|
||||
import { BaseTransaction, verifyBaseTransaction } from "./common"
|
||||
|
||||
export interface OfferCancel extends BaseTransaction {
|
||||
TransactionType: "OfferCancel"
|
||||
OfferSequence: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify the form and type of an OfferCancel at runtime.
|
||||
*
|
||||
* @param tx - An OfferCancel Transaction
|
||||
* @returns - Void.
|
||||
* @throws - When the OfferCancel is Malformed.
|
||||
*/
|
||||
export function verifyOfferCancel(tx: OfferCancel): void {
|
||||
verifyBaseTransaction(tx)
|
||||
|
||||
if (tx.OfferSequence === undefined)
|
||||
throw new ValidationError("OfferCancel: missing field OfferSequence")
|
||||
|
||||
if (typeof tx.OfferSequence !== 'number')
|
||||
throw new ValidationError("OfferCancel: OfferSequence must be a number")
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
import Metadata from "../common/metadata";
|
||||
import { OfferCreate } from "./offerCreate";
|
||||
import { CheckCash } from "./checkCash";
|
||||
import { CheckCancel } from "./checkCancel";
|
||||
import { CheckCreate } from "./checkCreate";
|
||||
import { SignerListSet } from "./signerListSet";
|
||||
import Metadata from "../common/metadata"
|
||||
import { OfferCreate } from "./offerCreate"
|
||||
import { OfferCancel } from "./offerCancel"
|
||||
import { CheckCash } from "./checkCash"
|
||||
import { CheckCancel } from "./checkCancel"
|
||||
import { CheckCreate } from "./checkCreate"
|
||||
import { SignerListSet } from "./signerListSet"
|
||||
import { AccountSet } from "./accountSet";
|
||||
|
||||
export type Transaction =
|
||||
@@ -16,6 +17,7 @@ export type Transaction =
|
||||
// | EscrowCancel
|
||||
// | EscrowCreate
|
||||
// | EscrowFinish
|
||||
| OfferCancel
|
||||
// | OfferCancel
|
||||
| OfferCreate
|
||||
// | PaymentTransaction
|
||||
|
||||
Reference in New Issue
Block a user