From d8b5fa57fed29c32a2e31009479f21dc5115daed Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Wed, 18 May 2022 00:20:28 +0300 Subject: [PATCH] refactor: specify signTransaction type --- src/account/base.ts | 4 ++-- src/account/resolver.ts | 4 ++-- src/account/rpc.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/account/base.ts b/src/account/base.ts index 7c6e4b90be..51592ac992 100644 --- a/src/account/base.ts +++ b/src/account/base.ts @@ -63,9 +63,9 @@ export abstract class _AccountBase { * @return {String} Signed transaction */ async signTransaction ( - tx: string, + tx: EncodedData<'tx'>, { innerTx, networkId, ...options }: { innerTx?: boolean, networkId?: string } = {} - ): Promise { + ): Promise> { const prefixes = [this.getNetworkId({ networkId })] if (innerTx === true) prefixes.push('inner_tx') const rlpBinaryTx = decode(tx, 'tx') diff --git a/src/account/resolver.ts b/src/account/resolver.ts index 5270f8e361..b5f14b8872 100644 --- a/src/account/resolver.ts +++ b/src/account/resolver.ts @@ -24,9 +24,9 @@ export class _AccountResolver extends _AccountBase { } async signTransaction ( - tx: string, + tx: EncodedData<'tx'>, { onAccount, ...options }: { onAccount?: Account } & Parameters<_AccountBase['signTransaction']>[1] = {} - ): Promise { + ): Promise> { return await this._resolveAccount(onAccount) .signTransaction(tx, { ...options, networkId: this.getNetworkId(options) }) } diff --git a/src/account/rpc.ts b/src/account/rpc.ts index 6c92ca5242..51a52cac8b 100644 --- a/src/account/rpc.ts +++ b/src/account/rpc.ts @@ -36,8 +36,8 @@ class _AccountRpc extends _AccountBase { * @return {Promise} Signed transaction */ async signTransaction ( - tx: string, options: Parameters<_AccountBase['signTransaction']>[1] - ): Promise { + tx: EncodedData<'tx'>, options: Parameters<_AccountBase['signTransaction']>[1] + ): Promise> { return this._rpcClient.request(METHODS.sign, { ...options, onAccount: this._address,