diff --git a/src/evm/engine/ether/index.ts b/src/evm/engine/ether/index.ts index 78e2f51..1bb315c 100644 --- a/src/evm/engine/ether/index.ts +++ b/src/evm/engine/ether/index.ts @@ -124,7 +124,7 @@ export class EthersEvmEngine implements IEVMEngine { */ private async generateTransaction( input: EvmInput, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): Promise> { if (!this.provider || !this.contract) { return { @@ -463,7 +463,7 @@ export class EthersEvmEngine implements IEVMEngine { */ async send( input: EvmInput, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): Promise> { if (!this.provider || !this.contract) { return { @@ -551,7 +551,7 @@ export class EthersEvmEngine implements IEVMEngine { */ async sign( input: EvmInput, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): Promise> { if (!this.provider || !this.contract) { return { diff --git a/src/evm/engine/utils/index.ts b/src/evm/engine/utils/index.ts index 90155ed..93f8a08 100644 --- a/src/evm/engine/utils/index.ts +++ b/src/evm/engine/utils/index.ts @@ -201,11 +201,11 @@ export function parseEvmReplyData(data: any): Array | any { */ export function getFromAddress( wallet: IWallet, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): string { let result: string const fromResult = wallet && wallet.getDefault() - if (!options.from) { + if (!options || !options.from) { if (!fromResult || !fromResult.ok || !fromResult.data) { return "" } else { @@ -229,11 +229,11 @@ export function getFromAddress( */ export function getFromPrivateKey( wallet: IWallet, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): string { let result: string const fromResult = wallet && wallet.getDefault() - if (!options.privateKey || !options.from) { + if (!options || !options.privateKey || !options.from) { if (!fromResult || !fromResult.ok || !fromResult.data) { return "" } else { diff --git a/src/evm/engine/web3/index.ts b/src/evm/engine/web3/index.ts index 9534bb2..4119ba9 100644 --- a/src/evm/engine/web3/index.ts +++ b/src/evm/engine/web3/index.ts @@ -132,7 +132,7 @@ export class Web3EvmEngine implements IEVMEngine { */ private async generateTransaction( input: EvmInput, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): Promise> { if (!this.web3Object || !this.contractObject) { return { @@ -583,7 +583,7 @@ export class Web3EvmEngine implements IEVMEngine { */ async send( input: EvmInput, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): Promise> { if (!this.web3Object || !this.contractObject) { return { @@ -705,7 +705,7 @@ export class Web3EvmEngine implements IEVMEngine { */ async sign( input: EvmInput, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): Promise> { if (!this.web3Object || !this.contractObject) { return { diff --git a/src/evm/interface/index.ts b/src/evm/interface/index.ts index a1c1048..4fe3a56 100644 --- a/src/evm/interface/index.ts +++ b/src/evm/interface/index.ts @@ -255,7 +255,7 @@ export interface IEVMEngine { */ send( input: EvmInput, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): Promise> /** @@ -275,7 +275,7 @@ export interface IEVMEngine { */ sign( input: EvmInput, - options: EvmTransactionOptions + options?: EvmTransactionOptions ): Promise> }