aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
index 48bd00f90..5a4b40547 100644
--- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
@@ -21,6 +21,7 @@ import {
} from '../types';
import { assert } from '../utils/assert';
import { decorators } from '../utils/decorators';
+import { TransactionEncoder } from '../utils/transaction_encoder';
import { ContractWrapper } from './contract_wrapper';
import { ExchangeContract, ExchangeEventArgs, ExchangeEvents } from './generated/exchange';
@@ -1097,6 +1098,16 @@ export class ExchangeWrapper extends ContractWrapper {
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxTokenAddress);
return zrxAssetData;
}
+ /**
+ * Returns a Transaction Encoder. Transaction messages exist for the purpose of calling methods on the Exchange contract
+ * in the context of another address.
+ * @return TransactionEncoder
+ */
+ public async transactionEncoderAsync(): Promise<TransactionEncoder> {
+ const exchangeInstance = await this._getExchangeContractAsync();
+ const encoder = new TransactionEncoder(exchangeInstance);
+ return encoder;
+ }
// tslint:disable:no-unused-variable
private _invalidateContractInstances(): void {
this.unsubscribeAll();