diff options
Diffstat (limited to 'packages/contract-wrappers/src/utils/transaction_encoder.ts')
-rw-r--r-- | packages/contract-wrappers/src/utils/transaction_encoder.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/contract-wrappers/src/utils/transaction_encoder.ts b/packages/contract-wrappers/src/utils/transaction_encoder.ts index 307487a9b..0832ee73a 100644 --- a/packages/contract-wrappers/src/utils/transaction_encoder.ts +++ b/packages/contract-wrappers/src/utils/transaction_encoder.ts @@ -242,6 +242,23 @@ export class TransactionEncoder { return abiEncodedData; } /** + * Encodes a matchOrders transaction. + * @param leftOrder First order to match. + * @param rightOrder Second order to match. + * @return Hex encoded abi of the function call. + */ + public matchOrdersTx(leftOrder: SignedOrder, rightOrder: SignedOrder): string { + assert.doesConformToSchema('leftOrder', leftOrder, schemas.orderSchema); + assert.doesConformToSchema('rightOrder', rightOrder, schemas.orderSchema); + const abiEncodedData = this._getExchangeContract().matchOrders.getABIEncodedTransactionData( + leftOrder, + rightOrder, + leftOrder.signature, + rightOrder.signature, + ); + return abiEncodedData; + } + /** * Encodes a preSign transaction. * @param hash Hash to pre-sign * @param signerAddress Address that should have signed the given hash. |