aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src/utils/transaction_encoder.ts
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2019-02-01 09:55:23 +0800
committerGreg Hysen <greg.hysen@gmail.com>2019-02-09 08:25:30 +0800
commit5a231fb0575a00dfcf1237ec4e733cbeb96e984d (patch)
tree5121cac79bb8deb78ac4fa60c7d1d0eac8b8e35e /packages/contract-wrappers/src/utils/transaction_encoder.ts
parent63f41df3272060bf44924c586fd882595428eff6 (diff)
downloaddexon-0x-contracts-5a231fb0575a00dfcf1237ec4e733cbeb96e984d.tar.gz
dexon-0x-contracts-5a231fb0575a00dfcf1237ec4e733cbeb96e984d.tar.zst
dexon-0x-contracts-5a231fb0575a00dfcf1237ec4e733cbeb96e984d.zip
Prep for txData decoder tests
Diffstat (limited to 'packages/contract-wrappers/src/utils/transaction_encoder.ts')
-rw-r--r--packages/contract-wrappers/src/utils/transaction_encoder.ts17
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..5faa593a5 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
+ * @param rightOrder
+ * @return Hex encoded abi of the function call.
+ */
+ public matchOrdersTx(leftOrder: SignedOrder, rightOrder: SignedOrder): string {
+ assert.doesConformToSchema('order', leftOrder, schemas.orderSchema);
+ assert.doesConformToSchema('order', 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.