diff --git a/.npmignore b/.npmignore
index 05524a6..c62904d 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,3 +1,6 @@
.env
*.log
.idea
+src
+tests
+node_modules
diff --git a/README.md b/README.md
index f058c78..45f895d 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ https://developers.tron.network/reference/tronweb-object
### Installation
-Required: node v14/16 LTS
+Required: node v14+ LTS
```shell
npm install --save-dev @daochild/tronweb-typescript
@@ -16,12 +16,7 @@ npm install --save-dev @daochild/tronweb-typescript
### Using
-Watch example in ``./src/tests/test.ts``
-
-Import should be looks like this:
-```typescript
-import * as tronwebTypes from "@types/tronweb";
-```
+No special requirements. Just import and use.
### Would be nice to do
diff --git a/package.json b/package.json
index 9f006b9..e55c036 100644
--- a/package.json
+++ b/package.json
@@ -1,9 +1,9 @@
{
"name": "@daochild/tronweb-typescript",
- "version": "1.0.103",
+ "version": "1.1.0",
"description": "Typescript support package for tronweb library ^4.x",
- "main": "",
- "types": "./src/index.d.ts",
+ "types": "./dist/index",
+ "type": "module",
"keywords": ["tron", "tronweb", "typescript", "tronweb-typescript", "tronweb-ts"],
"scripts": {
"start": "npm run build && node build/index.js",
diff --git a/src/index.ts b/src/index.ts
index b99ed96..0910eea 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,3 +1,190 @@
-'use strict';
+declare module 'tronweb' {
+ import {BigNumber} from "bignumber.js"
+ import {
+ Account,
+ AccountMnemonic,
+ AssetTRC10,
+ AssetUpdate,
+ BlockInfo,
+ BlockInput,
+ BlockTransaction,
+ BytesLike,
+ ChainParameter,
+ ContractExecutionParams,
+ CreateRandomOptions,
+ DelegatedResourceAccount,
+ DelegatedResourceList,
+ EnergyEstimate,
+ EventResult,
+ Exchange,
+ Header,
+ HexString,
+ JsonFragment,
+ KeyValue,
+ Miner,
+ NodeInfo,
+ Proposal,
+ Resource,
+ SideOptions,
+ TokenInfo,
+ Transaction,
+ TransactionResult,
+ TriggerConstantContractResult,
+ TronAccountResource,
+ TronContract,
+ TronContractResult,
+ TronWebConstructor,
+ TrxAccount
+ } from "tronweb/interfaces";
-///
+ export class TronWeb {
+ address: any;
+ transactionBuilder: any;
+ trx: any;
+ utils: any;
+ constructor(fullNode: string, solidityNode: string, eventServer: string|boolean, privateKey?: string|boolean);
+ constructor(fullNode: string, solidityNode: string, eventServer: string|boolean, sideOptions: SideOptions, privateKey?: string|boolean);
+ constructor(obj: TronWebConstructor);
+ contract(data: JsonFragment[], address: string): TronContract;
+ setHeader(header: Header): void|Error;
+ currentProvider(): any;
+ currentProviders(): any;
+ getEventByTransactionID(transactionID: string): Promise;
+ getEventResult(contractAddress: string, options?: Object): Promise; // check this return
+ isConnected(): Object;
+ isValidProvider(provider: any): any;
+ setAddress(address: string): void|Error;
+ setDefaultBlock(blockID?: BlockInput): void|string|boolean;
+ setEventServer(eventServer: any): void|Error;
+ setFullNode(fullNode: any): void|Error;
+ setPrivateKey(privateKey: string): void|Error;
+ setSolidityNode(solidityNode: any): void|Error;
+ createAccount(): Promise;
+ createRandom(options?: CreateRandomOptions): Promise;
+ fromAscii(string: any, padding: any): any;
+ fromDecimal(value: number|string): string;
+ fromSun(sun: string|number): string;
+ fromUtf8(string: string): string;
+ fromMnemonic(mnemonic: string, path?: string, wordlist?: string): AccountMnemonic|Error;
+ isAddress(address: string): boolean;
+ sha3(string: string, prefix?: boolean): HexString;
+ toAscii(hex: HexString): string;
+ toBigNumber(amount: number|string|HexString): BigNumber|Object;
+ toDecimal(value: string|HexString): number|string;
+ toHex(val: string|number|object|[]|BigNumber): HexString;
+ toSun(trx: number): string;
+ toUtf8(hex: string): string;
+ BigNumber(val: number|string|HexString): BigNumber
+ }
+
+ export namespace TronWeb {
+ export namespace transactionBuilder {
+ function addUpdateData(unsignedTransaction: JSON|Object, memo: string): Promise;
+ function applyForSR(address: string, url: string, options?: number): Promise;
+ function createAccount(address: string, options?: JSON|Object): Promise;
+ function createAsset(options: AssetTRC10, issuerAddress: string): Promise;
+ function createProposal(parameters: KeyValue[], issuerAddress: string, options?: number): Promise;
+ function createSmartContract(options: ContractExecutionParams, issuerAddress: string): Promise;
+ function createToken(options: AssetTRC10, issuerAddress: string): Promise;
+ function delegateResource(amount: number, receiverAddress: string, resource: string, address: string, lock: boolean, options?: Object): Promise