return tx_receipt type from write tx
MODIFY
src/interfaces/index.ts
src/interfaces/index.ts
@@ -6,3 +6,4 @@ export * from "./send_result";
export * from "./transaction";
export * from "./transaction_option";
export * from "./contract_init_param";
+export * from "./tx_receipt";
\ No newline at end of file

ADD
src/interfaces/tx_receipt.ts
+export interface ITransactionReceipt {
+ transactionHash: string;
+ transactionIndex: number;
+ blockHash: string;
+ blockNumber: number;
+ from: string;
+ to: string;
+ contractAddress: string;
+ cumulativeGasUsed: number;
+ gasUsed: number;
+ logs?: ILog[];
+ events?: {
+ [eventName: string]: IEventLog;
+ };
+ status: boolean;
+}
+
+export interface ILog {
+ address: string;
+ data: string;
+ topics: string[];
+ logIndex: number;
+ transactionHash: string;
+ transactionIndex: number;
+ blockHash: string;
+ blockNumber: number;
+}
+
+export interface IEventLog {
+ event: string;
+ address: string;
+ returnValues: any;
+ logIndex: number;
+ transactionIndex: number;
+ transactionHash: string;
+ blockHash: string;
+ blockNumber: number;
+ raw?: { data: string; topics: string[] };
+}
\ No newline at end of file

MODIFY
src/model/base_token.ts
src/model/base_token.ts
@@ -4,6 +4,7 @@ import { BaseContractMethod } from "../abstracts";
import { BaseContract } from "./eth_contract";
import { eventBusPromise, merge, IEventBusPromise } from "../utils";
import { EXTRA_GAS_FOR_PROXY_CALL } from "../constant";
+import { ITransactionReceipt } from "../interfaces";
interface ITransactionConfigParam {
txConfig: ITransactionConfig;
@@ -24,7 +25,7 @@ export class BaseToken {
}
protected processWrite(method: BaseContractMethod, option: ITransactionOption) {
- const result = eventBusPromise((res, rej) => {
+ const result = eventBusPromise<ITransactionReceipt>((res, rej) => {
// tslint:disable-next-line
this.createTransactionConfig(
{

return tx_receipt type from write tx