Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 2b57a8f

Browse files
authored
Merge pull request #231 from Zilliqa/fix/api
Fix getTransaction and getSmartContracts
2 parents ffb5854 + 0263cec commit 2b57a8f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/zilliqa-js-blockchain/src/chain.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ import {
3636
ZilliqaModule,
3737
} from '@zilliqa-js/core';
3838

39-
import { Omit } from 'utility-types';
40-
4139
import { toTxParams } from './util';
4240

4341
export class Blockchain implements ZilliqaModule {
@@ -592,11 +590,9 @@ export class Blockchain implements ZilliqaModule {
592590
* getSmartContracts
593591
*
594592
* @param {string} address
595-
* @returns {Promise<RPCResponse<Omit<ContractObj, 'init' | 'abi'>, string>>}
593+
* @returns {Promise<RPCResponse<ContractObj[], string>>}
596594
*/
597-
getSmartContracts(
598-
addr: string,
599-
): Promise<RPCResponse<Omit<ContractObj, 'init' | 'abi'>, string>> {
595+
getSmartContracts(addr: string): Promise<RPCResponse<ContractObj[], string>> {
600596
const address = validation.isBech32(addr) ? fromBech32Address(addr) : addr;
601597
return this.provider.send(
602598
RPCMethod.GetSmartContracts,

packages/zilliqa-js-blockchain/src/util.ts

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export function toTxParams(
5757
gasLimit: Long.fromString(gasLimit, 10),
5858
amount: new BN(amount),
5959
nonce: parseInt(nonce, 10),
60+
code,
61+
data,
6062
receipt: {
6163
...receipt,
6264
accepted: receipt.accepted,

0 commit comments

Comments
 (0)