rename  ITransactionConfig -> ITransactionRequestConfig
MODIFY
.npmignore
.npmignore
@@ -5,3 +5,7 @@ src
build_helper
test
*.env
+examples
+webpack
+docs
+test
\ No newline at end of file

MODIFY
src/abstracts/base_web3_client.ts
src/abstracts/base_web3_client.ts
import { BaseContract } from "../abstracts";
-import { ITransactionConfig, ITransactionReceipt, ITransactionData, IBlock, IBlockWithTransaction, IJsonRpcRequestPayload, IJsonRpcResponse, ITransactionWriteResult } from "../interfaces";
+import { ITransactionRequestConfig, ITransactionReceipt, ITransactionData, IBlock, IBlockWithTransaction, IJsonRpcRequestPayload, IJsonRpcResponse, ITransactionWriteResult } from "../interfaces";
import { Logger } from "../utils";
export abstract class BaseWeb3Client {
@@ -10,11 +10,11 @@ export abstract class BaseWeb3Client {
abstract getContract(address: string, abi: any): BaseContract;
- abstract read(config: ITransactionConfig): Promise<string>;
+ abstract read(config: ITransactionRequestConfig): Promise<string>;
- abstract write(config: ITransactionConfig): ITransactionWriteResult;
+ abstract write(config: ITransactionRequestConfig): ITransactionWriteResult;
abstract getGasPrice(): Promise<string>;
- abstract estimateGas(config: ITransactionConfig): Promise<number>;
+ abstract estimateGas(config: ITransactionRequestConfig): Promise<number>;
abstract getChainId(): Promise<number>;
abstract getTransactionCount(address: string, blockNumber: any): Promise<number>;

MODIFY
src/abstracts/contract_method.ts
src/abstracts/contract_method.ts
-import { ITransactionConfig, ITransactionWriteResult } from "../interfaces";
+import { ITransactionRequestConfig, ITransactionWriteResult } from "../interfaces";
import { Logger } from "../utils";
export abstract class BaseContractMethod {
@@ -6,8 +6,8 @@ export abstract class BaseContractMethod {
}
abstract get address(): string;
- abstract read<T>(tx?: ITransactionConfig,): Promise<T>;
- abstract write(tx: ITransactionConfig,): ITransactionWriteResult;
- abstract estimateGas(tx: ITransactionConfig,): Promise<number>;
+ abstract read<T>(tx?: ITransactionRequestConfig,): Promise<T>;
+ abstract write(tx: ITransactionRequestConfig,): ITransactionWriteResult;
+ abstract estimateGas(tx: ITransactionRequestConfig,): Promise<number>;
abstract encodeABI(): any;
}
\ No newline at end of file

MODIFY
src/interfaces/transaction_config.ts
src/interfaces/transaction_config.ts
import { BaseBigNumber } from "../abstracts";
-export interface ITransactionConfig {
+export interface ITransactionRequestConfig {
from?: string;
to?: string;
value?: number | string | BaseBigNumber;

MODIFY
src/interfaces/transaction_option.ts
src/interfaces/transaction_option.ts
-import { ITransactionConfig } from "./transaction_config";
+import { ITransactionRequestConfig } from "./transaction_config";
-export interface ITransactionOption extends ITransactionConfig {
+export interface ITransactionOption extends ITransactionRequestConfig {
returnTransaction?: boolean;
}
\ No newline at end of file

MODIFY
src/interfaces/transaction_result.ts
src/interfaces/transaction_result.ts
-import { ITransactionConfig } from "./transaction_config";
+import { ITransactionRequestConfig } from "./transaction_config";
export interface ITransactionResult {
- estimateGas(tx?: ITransactionConfig): Promise<number>;
+ estimateGas(tx?: ITransactionRequestConfig): Promise<number>;
encodeABI(): string;
}
\ No newline at end of file

MODIFY
src/utils/base_token.ts
src/utils/base_token.ts
import { Web3SideChainClient } from "./web3_side_chain_client";
-import { ITransactionConfig, ITransactionOption, IContractInitParam, IPOSClientConfig, IBaseClientConfig } from "../interfaces";
+import { ITransactionRequestConfig, ITransactionOption, IContractInitParam, IPOSClientConfig, IBaseClientConfig } from "../interfaces";
import { BaseContractMethod, BaseContract, BaseWeb3Client } from "../abstracts";
import { Converter, merge } from "../utils";
import { ContractWriteResult } from "../helpers";
@@ -9,7 +9,7 @@ import { TYPE_AMOUNT } from "../types";
import { ErrorHelper } from "./error_helper";
export interface ITransactionConfigParam {
- txConfig: ITransactionConfig;
+ txConfig: ITransactionRequestConfig;
method?: BaseContractMethod;
isWrite?: boolean;
isParent?: boolean;
@@ -60,7 +60,7 @@ export class BaseToken<T_CLIENT_CONFIG> {
return merge(config, {
data: method.encodeABI(),
to: method.address
- } as ITransactionConfig);
+ } as ITransactionRequestConfig);
}
const methodResult = method.write(
config,
@@ -139,7 +139,7 @@ export class BaseToken<T_CLIENT_CONFIG> {
return merge(config, {
data: method.encodeABI(),
to: this.contract_.address
- } as ITransactionConfig);
+ } as ITransactionRequestConfig);
}
return method.read(
config,
@@ -173,7 +173,7 @@ export class BaseToken<T_CLIENT_CONFIG> {
const client = isParent ? this.client.parent :
this.client.child;
client.logger.log("txConfig", txConfig, "onRoot", isParent, "isWrite", isWrite);
- const estimateGas = (config: ITransactionConfig) => {
+ const estimateGas = (config: ITransactionRequestConfig) => {
return method ? method.estimateGas(config) :
client.estimateGas(config);
};
@@ -228,7 +228,7 @@ export class BaseToken<T_CLIENT_CONFIG> {
});
});
}
- return promiseResolve<ITransactionConfig>(txConfig);
+ return promiseResolve<ITransactionRequestConfig>(txConfig);
}
protected transferERC20(to: string, amount: TYPE_AMOUNT, option?: ITransactionOption) {

rename  ITransactionConfig -> ITransactionRequestConfig