-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
packages/xrpl/src/models/transactions/XChainModifyBridge.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ValidationError } from '../../errors' | ||
import { Amount, XChainBridge } from '../common' | ||
|
||
import { BaseTransaction, validateBaseTransaction } from './common' | ||
|
||
/** | ||
* | ||
* @category Transaction Models | ||
*/ | ||
export interface XChainModifyBridge extends BaseTransaction { | ||
TransactionType: 'XChainModifyBridge' | ||
|
||
XChainBridge: XChainBridge | ||
|
||
SignatureReward: Amount | ||
|
||
MinAccountCreateAmount?: Amount | ||
} | ||
|
||
/** | ||
* Verify the form and type of a XChainModifyBridge at runtime. | ||
* | ||
* @param tx - A XChainModifyBridge Transaction. | ||
* @throws When the XChainModifyBridge is malformed. | ||
*/ | ||
export function validateXChainModifyBridge(tx: Record<string, unknown>): void { | ||
validateBaseTransaction(tx) | ||
|
||
if (tx.XChainBridge == null) { | ||
throw new ValidationError('XChainModifyBridge: missing field XChainBridge') | ||
} | ||
|
||
if (tx.SignatureReward == null) { | ||
throw new ValidationError( | ||
'XChainModifyBridge: missing field SignatureReward', | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters