tronwb 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +201 -0
- package/dist/TronWeb.js +3 -0
- package/dist/TronWeb.js.LICENSE.txt +12 -0
- package/dist/TronWeb.js.map +1 -0
- package/dist/TronWeb.node.js +2 -0
- package/dist/TronWeb.node.js.map +1 -0
- package/kj9btptx.cjs +1 -0
- package/lib/commonjs/index.d.ts +64 -0
- package/lib/commonjs/index.js +37 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.d.ts +127 -0
- package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.js +1771 -0
- package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.js.map +1 -0
- package/lib/commonjs/lib/TransactionBuilder/helper.d.ts +28 -0
- package/lib/commonjs/lib/TransactionBuilder/helper.js +122 -0
- package/lib/commonjs/lib/TransactionBuilder/helper.js.map +1 -0
- package/lib/commonjs/lib/contract/index.d.ts +29 -0
- package/lib/commonjs/lib/contract/index.js +124 -0
- package/lib/commonjs/lib/contract/index.js.map +1 -0
- package/lib/commonjs/lib/contract/method.d.ts +50 -0
- package/lib/commonjs/lib/contract/method.js +238 -0
- package/lib/commonjs/lib/contract/method.js.map +1 -0
- package/lib/commonjs/lib/event.d.ts +85 -0
- package/lib/commonjs/lib/event.js +137 -0
- package/lib/commonjs/lib/event.js.map +1 -0
- package/lib/commonjs/lib/plugin.d.ts +28 -0
- package/lib/commonjs/lib/plugin.js +84 -0
- package/lib/commonjs/lib/plugin.js.map +1 -0
- package/lib/commonjs/lib/providers/HttpProvider.d.ts +15 -0
- package/lib/commonjs/lib/providers/HttpProvider.js +63 -0
- package/lib/commonjs/lib/providers/HttpProvider.js.map +1 -0
- package/lib/commonjs/lib/providers/index.d.ts +6 -0
- package/lib/commonjs/lib/providers/index.js +8 -0
- package/lib/commonjs/lib/providers/index.js.map +1 -0
- package/lib/commonjs/lib/trx.d.ts +315 -0
- package/lib/commonjs/lib/trx.js +965 -0
- package/lib/commonjs/lib/trx.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/paramValidator/index.d.ts +19 -0
- package/lib/commonjs/paramValidator/index.js +110 -0
- package/lib/commonjs/paramValidator/index.js.map +1 -0
- package/lib/commonjs/protocol/core/Tron_pb.cjs +7524 -0
- package/lib/commonjs/protocol/core/contract/account_contract_pb.cjs +961 -0
- package/lib/commonjs/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
- package/lib/commonjs/protocol/core/contract/balance_contract_pb.cjs +3826 -0
- package/lib/commonjs/protocol/core/contract/common_pb.cjs +34 -0
- package/lib/commonjs/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
- package/lib/commonjs/protocol/core/contract/proposal_contract_pb.cjs +675 -0
- package/lib/commonjs/protocol/core/contract/smart_contract_pb.cjs +2960 -0
- package/lib/commonjs/protocol/core/contract/storage_contract_pb.cjs +848 -0
- package/lib/commonjs/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
- package/lib/commonjs/protocol/core/contract/witness_contract_pb.cjs +956 -0
- package/lib/commonjs/tronweb.d.ts +111 -0
- package/lib/commonjs/tronweb.js +365 -0
- package/lib/commonjs/tronweb.js.map +1 -0
- package/lib/commonjs/types/ABI.d.ts +59 -0
- package/lib/commonjs/types/ABI.js +3 -0
- package/lib/commonjs/types/ABI.js.map +1 -0
- package/lib/commonjs/types/APIResponse.d.ts +31 -0
- package/lib/commonjs/types/APIResponse.js +3 -0
- package/lib/commonjs/types/APIResponse.js.map +1 -0
- package/lib/commonjs/types/Contract.d.ts +287 -0
- package/lib/commonjs/types/Contract.js +63 -0
- package/lib/commonjs/types/Contract.js.map +1 -0
- package/lib/commonjs/types/Providers.d.ts +8 -0
- package/lib/commonjs/types/Providers.js +3 -0
- package/lib/commonjs/types/Providers.js.map +1 -0
- package/lib/commonjs/types/Transaction.d.ts +65 -0
- package/lib/commonjs/types/Transaction.js +3 -0
- package/lib/commonjs/types/Transaction.js.map +1 -0
- package/lib/commonjs/types/TransactionBuilder.d.ts +270 -0
- package/lib/commonjs/types/TransactionBuilder.js +3 -0
- package/lib/commonjs/types/TransactionBuilder.js.map +1 -0
- package/lib/commonjs/types/TronWeb.d.ts +20 -0
- package/lib/commonjs/types/TronWeb.js +3 -0
- package/lib/commonjs/types/TronWeb.js.map +1 -0
- package/lib/commonjs/types/Trx.d.ts +263 -0
- package/lib/commonjs/types/Trx.js +42 -0
- package/lib/commonjs/types/Trx.js.map +1 -0
- package/lib/commonjs/types/UtilsTypes.d.ts +23 -0
- package/lib/commonjs/types/UtilsTypes.js +3 -0
- package/lib/commonjs/types/UtilsTypes.js.map +1 -0
- package/lib/commonjs/types/index.d.ts +9 -0
- package/lib/commonjs/types/index.js +13 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/utils/abi.d.ts +5 -0
- package/lib/commonjs/utils/abi.js +251 -0
- package/lib/commonjs/utils/abi.js.map +1 -0
- package/lib/commonjs/utils/accounts.d.ts +22 -0
- package/lib/commonjs/utils/accounts.js +51 -0
- package/lib/commonjs/utils/accounts.js.map +1 -0
- package/lib/commonjs/utils/address.d.ts +12 -0
- package/lib/commonjs/utils/address.js +91 -0
- package/lib/commonjs/utils/address.js.map +1 -0
- package/lib/commonjs/utils/base58.d.ts +3 -0
- package/lib/commonjs/utils/base58.js +68 -0
- package/lib/commonjs/utils/base58.js.map +1 -0
- package/lib/commonjs/utils/base64.d.ts +10 -0
- package/lib/commonjs/utils/base64.js +173 -0
- package/lib/commonjs/utils/base64.js.map +1 -0
- package/lib/commonjs/utils/bytes.d.ts +7 -0
- package/lib/commonjs/utils/bytes.js +61 -0
- package/lib/commonjs/utils/bytes.js.map +1 -0
- package/lib/commonjs/utils/code.d.ts +12 -0
- package/lib/commonjs/utils/code.js +166 -0
- package/lib/commonjs/utils/code.js.map +1 -0
- package/lib/commonjs/utils/crypto.d.ts +25 -0
- package/lib/commonjs/utils/crypto.js +222 -0
- package/lib/commonjs/utils/crypto.js.map +1 -0
- package/lib/commonjs/utils/ethersUtils.d.ts +14 -0
- package/lib/commonjs/utils/ethersUtils.js +39 -0
- package/lib/commonjs/utils/ethersUtils.js.map +1 -0
- package/lib/commonjs/utils/fragments.d.ts +465 -0
- package/lib/commonjs/utils/fragments.js +1342 -0
- package/lib/commonjs/utils/fragments.js.map +1 -0
- package/lib/commonjs/utils/help.d.ts +8 -0
- package/lib/commonjs/utils/help.js +61 -0
- package/lib/commonjs/utils/help.js.map +1 -0
- package/lib/commonjs/utils/index.d.ts +56 -0
- package/lib/commonjs/utils/index.js +43 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/interface.d.ts +381 -0
- package/lib/commonjs/utils/interface.js +1121 -0
- package/lib/commonjs/utils/interface.js.map +1 -0
- package/lib/commonjs/utils/message.d.ts +4 -0
- package/lib/commonjs/utils/message.js +38 -0
- package/lib/commonjs/utils/message.js.map +1 -0
- package/lib/commonjs/utils/transaction.d.ts +17 -0
- package/lib/commonjs/utils/transaction.js +678 -0
- package/lib/commonjs/utils/transaction.js.map +1 -0
- package/lib/commonjs/utils/typedData.d.ts +148 -0
- package/lib/commonjs/utils/typedData.js +498 -0
- package/lib/commonjs/utils/typedData.js.map +1 -0
- package/lib/commonjs/utils/validations.d.ts +22 -0
- package/lib/commonjs/utils/validations.js +128 -0
- package/lib/commonjs/utils/validations.js.map +1 -0
- package/lib/esm/index.d.ts +64 -0
- package/lib/esm/index.js +33 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/lib/TransactionBuilder/TransactionBuilder.d.ts +127 -0
- package/lib/esm/lib/TransactionBuilder/TransactionBuilder.js +1767 -0
- package/lib/esm/lib/TransactionBuilder/TransactionBuilder.js.map +1 -0
- package/lib/esm/lib/TransactionBuilder/helper.d.ts +28 -0
- package/lib/esm/lib/TransactionBuilder/helper.js +112 -0
- package/lib/esm/lib/TransactionBuilder/helper.js.map +1 -0
- package/lib/esm/lib/contract/index.d.ts +29 -0
- package/lib/esm/lib/contract/index.js +118 -0
- package/lib/esm/lib/contract/index.js.map +1 -0
- package/lib/esm/lib/contract/method.d.ts +50 -0
- package/lib/esm/lib/contract/method.js +233 -0
- package/lib/esm/lib/contract/method.js.map +1 -0
- package/lib/esm/lib/event.d.ts +85 -0
- package/lib/esm/lib/event.js +132 -0
- package/lib/esm/lib/event.js.map +1 -0
- package/lib/esm/lib/plugin.d.ts +28 -0
- package/lib/esm/lib/plugin.js +79 -0
- package/lib/esm/lib/plugin.js.map +1 -0
- package/lib/esm/lib/providers/HttpProvider.d.ts +15 -0
- package/lib/esm/lib/providers/HttpProvider.js +59 -0
- package/lib/esm/lib/providers/HttpProvider.js.map +1 -0
- package/lib/esm/lib/providers/index.d.ts +6 -0
- package/lib/esm/lib/providers/index.js +4 -0
- package/lib/esm/lib/providers/index.js.map +1 -0
- package/lib/esm/lib/trx.d.ts +315 -0
- package/lib/esm/lib/trx.js +960 -0
- package/lib/esm/lib/trx.js.map +1 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/paramValidator/index.d.ts +19 -0
- package/lib/esm/paramValidator/index.js +106 -0
- package/lib/esm/paramValidator/index.js.map +1 -0
- package/lib/esm/protocol/core/Tron_pb.cjs +7524 -0
- package/lib/esm/protocol/core/contract/account_contract_pb.cjs +961 -0
- package/lib/esm/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
- package/lib/esm/protocol/core/contract/balance_contract_pb.cjs +3826 -0
- package/lib/esm/protocol/core/contract/common_pb.cjs +34 -0
- package/lib/esm/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
- package/lib/esm/protocol/core/contract/proposal_contract_pb.cjs +675 -0
- package/lib/esm/protocol/core/contract/smart_contract_pb.cjs +2960 -0
- package/lib/esm/protocol/core/contract/storage_contract_pb.cjs +848 -0
- package/lib/esm/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
- package/lib/esm/protocol/core/contract/witness_contract_pb.cjs +956 -0
- package/lib/esm/tronweb.d.ts +111 -0
- package/lib/esm/tronweb.js +360 -0
- package/lib/esm/tronweb.js.map +1 -0
- package/lib/esm/types/ABI.d.ts +59 -0
- package/lib/esm/types/ABI.js +2 -0
- package/lib/esm/types/ABI.js.map +1 -0
- package/lib/esm/types/APIResponse.d.ts +31 -0
- package/lib/esm/types/APIResponse.js +2 -0
- package/lib/esm/types/APIResponse.js.map +1 -0
- package/lib/esm/types/Contract.d.ts +287 -0
- package/lib/esm/types/Contract.js +60 -0
- package/lib/esm/types/Contract.js.map +1 -0
- package/lib/esm/types/Providers.d.ts +8 -0
- package/lib/esm/types/Providers.js +2 -0
- package/lib/esm/types/Providers.js.map +1 -0
- package/lib/esm/types/Transaction.d.ts +65 -0
- package/lib/esm/types/Transaction.js +2 -0
- package/lib/esm/types/Transaction.js.map +1 -0
- package/lib/esm/types/TransactionBuilder.d.ts +270 -0
- package/lib/esm/types/TransactionBuilder.js +2 -0
- package/lib/esm/types/TransactionBuilder.js.map +1 -0
- package/lib/esm/types/TronWeb.d.ts +20 -0
- package/lib/esm/types/TronWeb.js +2 -0
- package/lib/esm/types/TronWeb.js.map +1 -0
- package/lib/esm/types/Trx.d.ts +263 -0
- package/lib/esm/types/Trx.js +39 -0
- package/lib/esm/types/Trx.js.map +1 -0
- package/lib/esm/types/UtilsTypes.d.ts +23 -0
- package/lib/esm/types/UtilsTypes.js +2 -0
- package/lib/esm/types/UtilsTypes.js.map +1 -0
- package/lib/esm/types/index.d.ts +9 -0
- package/lib/esm/types/index.js +10 -0
- package/lib/esm/types/index.js.map +1 -0
- package/lib/esm/utils/abi.d.ts +5 -0
- package/lib/esm/utils/abi.js +245 -0
- package/lib/esm/utils/abi.js.map +1 -0
- package/lib/esm/utils/accounts.d.ts +22 -0
- package/lib/esm/utils/accounts.js +46 -0
- package/lib/esm/utils/accounts.js.map +1 -0
- package/lib/esm/utils/address.d.ts +12 -0
- package/lib/esm/utils/address.js +82 -0
- package/lib/esm/utils/address.js.map +1 -0
- package/lib/esm/utils/base58.d.ts +3 -0
- package/lib/esm/utils/base58.js +64 -0
- package/lib/esm/utils/base58.js.map +1 -0
- package/lib/esm/utils/base64.d.ts +10 -0
- package/lib/esm/utils/base64.js +169 -0
- package/lib/esm/utils/base64.js.map +1 -0
- package/lib/esm/utils/bytes.d.ts +7 -0
- package/lib/esm/utils/bytes.js +53 -0
- package/lib/esm/utils/bytes.js.map +1 -0
- package/lib/esm/utils/code.d.ts +12 -0
- package/lib/esm/utils/code.js +149 -0
- package/lib/esm/utils/code.js.map +1 -0
- package/lib/esm/utils/crypto.d.ts +25 -0
- package/lib/esm/utils/crypto.js +198 -0
- package/lib/esm/utils/crypto.js.map +1 -0
- package/lib/esm/utils/ethersUtils.d.ts +14 -0
- package/lib/esm/utils/ethersUtils.js +17 -0
- package/lib/esm/utils/ethersUtils.js.map +1 -0
- package/lib/esm/utils/fragments.d.ts +465 -0
- package/lib/esm/utils/fragments.js +1330 -0
- package/lib/esm/utils/fragments.js.map +1 -0
- package/lib/esm/utils/help.d.ts +8 -0
- package/lib/esm/utils/help.js +51 -0
- package/lib/esm/utils/help.js.map +1 -0
- package/lib/esm/utils/index.d.ts +56 -0
- package/lib/esm/utils/index.js +40 -0
- package/lib/esm/utils/index.js.map +1 -0
- package/lib/esm/utils/interface.d.ts +381 -0
- package/lib/esm/utils/interface.js +1112 -0
- package/lib/esm/utils/interface.js.map +1 -0
- package/lib/esm/utils/message.d.ts +4 -0
- package/lib/esm/utils/message.js +32 -0
- package/lib/esm/utils/message.js.map +1 -0
- package/lib/esm/utils/transaction.d.ts +17 -0
- package/lib/esm/utils/transaction.js +669 -0
- package/lib/esm/utils/transaction.js.map +1 -0
- package/lib/esm/utils/typedData.d.ts +148 -0
- package/lib/esm/utils/typedData.js +493 -0
- package/lib/esm/utils/typedData.js.map +1 -0
- package/lib/esm/utils/validations.d.ts +22 -0
- package/lib/esm/utils/validations.js +108 -0
- package/lib/esm/utils/validations.js.map +1 -0
- package/package.json +110 -0
- package/src/index.ts +42 -0
- package/src/lib/TransactionBuilder/TransactionBuilder.ts +2272 -0
- package/src/lib/TransactionBuilder/helper.ts +139 -0
- package/src/lib/contract/index.ts +151 -0
- package/src/lib/contract/method.ts +336 -0
- package/src/lib/event.ts +248 -0
- package/src/lib/plugin.ts +102 -0
- package/src/lib/providers/HttpProvider.ts +66 -0
- package/src/lib/providers/index.ts +6 -0
- package/src/lib/trx.ts +1463 -0
- package/src/paramValidator/index.ts +136 -0
- package/src/protocol/core/Tron_pb.cjs +7524 -0
- package/src/protocol/core/contract/account_contract_pb.cjs +961 -0
- package/src/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
- package/src/protocol/core/contract/balance_contract_pb.cjs +3826 -0
- package/src/protocol/core/contract/common_pb.cjs +34 -0
- package/src/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
- package/src/protocol/core/contract/proposal_contract_pb.cjs +675 -0
- package/src/protocol/core/contract/smart_contract_pb.cjs +2960 -0
- package/src/protocol/core/contract/storage_contract_pb.cjs +848 -0
- package/src/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
- package/src/protocol/core/contract/witness_contract_pb.cjs +956 -0
- package/src/tronweb.ts +437 -0
- package/src/types/ABI.ts +82 -0
- package/src/types/APIResponse.ts +34 -0
- package/src/types/Contract.ts +352 -0
- package/src/types/Providers.ts +7 -0
- package/src/types/Transaction.ts +70 -0
- package/src/types/TransactionBuilder.ts +281 -0
- package/src/types/TronWeb.ts +23 -0
- package/src/types/Trx.ts +285 -0
- package/src/types/UtilsTypes.ts +25 -0
- package/src/types/index.ts +9 -0
- package/src/types/interface.d.ts +1 -0
- package/src/utils/abi.ts +257 -0
- package/src/utils/accounts.ts +60 -0
- package/src/utils/address.ts +89 -0
- package/src/utils/base58.ts +78 -0
- package/src/utils/base64.ts +200 -0
- package/src/utils/bytes.ts +68 -0
- package/src/utils/code.ts +172 -0
- package/src/utils/crypto.ts +264 -0
- package/src/utils/ethersUtils.ts +60 -0
- package/src/utils/fragments.ts +1738 -0
- package/src/utils/help.ts +59 -0
- package/src/utils/index.ts +42 -0
- package/src/utils/interface.ts +1362 -0
- package/src/utils/message.ts +38 -0
- package/src/utils/transaction.ts +991 -0
- package/src/utils/typedData.ts +688 -0
- package/src/utils/validations.ts +130 -0
@@ -0,0 +1,270 @@
|
|
1
|
+
import { AbiFragment, ContractAbiInterface } from './ABI.js';
|
2
|
+
import { Transaction } from './Transaction.js';
|
3
|
+
export interface TransactionCommonOptions {
|
4
|
+
/**
|
5
|
+
* Permission id for multi-sign.
|
6
|
+
*/
|
7
|
+
permissionId?: number;
|
8
|
+
blockHeader?: Partial<Transaction['raw_data']>;
|
9
|
+
}
|
10
|
+
export type NumberLike = string | number;
|
11
|
+
export type Resource = 'BANDWIDTH' | 'ENERGY';
|
12
|
+
export interface VoteInfo {
|
13
|
+
[srAddress: string]: number;
|
14
|
+
}
|
15
|
+
export interface CreateSmartContractOptions extends TransactionCommonOptions {
|
16
|
+
/**
|
17
|
+
* The maximum TRX burns for resource consumption(1TRX = 1,000,000SUN).
|
18
|
+
*/
|
19
|
+
feeLimit?: number;
|
20
|
+
/**
|
21
|
+
* The TRX transfer to the contract for each call(1TRX = 1,000,000SUN)
|
22
|
+
*/
|
23
|
+
callValue?: number;
|
24
|
+
/**
|
25
|
+
* The id of trc10 token transfer to the contract (Optional)
|
26
|
+
*/
|
27
|
+
tokenId?: string;
|
28
|
+
/**
|
29
|
+
* The amount of trc10 token transfer to the contract for each call (Optional)
|
30
|
+
*/
|
31
|
+
tokenValue?: number;
|
32
|
+
/**
|
33
|
+
* Consume user's resource percentage. It should be an integer between [0, 100].
|
34
|
+
* if 0, means it does not consume user's resource until the developer's resource has been used up.
|
35
|
+
*/
|
36
|
+
userFeePercentage?: number;
|
37
|
+
/**
|
38
|
+
* The maximum resource consumption of the creator in one execution or creation.
|
39
|
+
*/
|
40
|
+
originEnergyLimit?: number;
|
41
|
+
/**
|
42
|
+
* Abi string
|
43
|
+
*/
|
44
|
+
abi: string | {
|
45
|
+
entrys: ContractAbiInterface;
|
46
|
+
} | ContractAbiInterface;
|
47
|
+
/**
|
48
|
+
* Bytecode, default hexString.
|
49
|
+
*/
|
50
|
+
bytecode: string;
|
51
|
+
/**
|
52
|
+
* The list of the parameters of the constructor.
|
53
|
+
* It should be converted hexString after encoded according to ABI encoder.
|
54
|
+
* If constructor has no parameter, this can be optional
|
55
|
+
*/
|
56
|
+
parameters?: unknown[];
|
57
|
+
/**
|
58
|
+
* Contract name string.
|
59
|
+
*/
|
60
|
+
name?: string;
|
61
|
+
/**
|
62
|
+
* Optional. raw parameters encoded according to [ABI Specification](https://docs.soliditylang.org/en/latest/abi-spec.html)
|
63
|
+
* For example: 0x0000000000000000000000000000000000000000000000000000000000000001.
|
64
|
+
*/
|
65
|
+
rawParameter?: string;
|
66
|
+
/**
|
67
|
+
* Optional. JSON format for contract function.
|
68
|
+
* For example: { "type":"function", "inputs": [{"name":"a","type":"uint256"}], "name":"foo", "outputs": [] }
|
69
|
+
*/
|
70
|
+
funcABIV2?: AbiFragment;
|
71
|
+
/**
|
72
|
+
* The parameters of the function specified by `funcABIV2`.
|
73
|
+
* Required if `funcABIV2` exists.
|
74
|
+
*/
|
75
|
+
parametersV2?: unknown[];
|
76
|
+
}
|
77
|
+
export interface TriggerSmartContractOptions extends TransactionCommonOptions {
|
78
|
+
/**
|
79
|
+
* The maximum TRX burns for resource consumption in SUN(1TRX = 1,000,000SUN).
|
80
|
+
*/
|
81
|
+
feeLimit?: number;
|
82
|
+
/**
|
83
|
+
* The TRX transfer to the contract for each call in SUN(1TRX = 1,000,000SUN)
|
84
|
+
*/
|
85
|
+
callValue?: number;
|
86
|
+
/**
|
87
|
+
* The id of trc10 token transfer to the contract (Optional)
|
88
|
+
*/
|
89
|
+
tokenId?: string;
|
90
|
+
/**
|
91
|
+
* The amount of trc10 token transfer to the contract for each call (Optional)
|
92
|
+
*/
|
93
|
+
tokenValue?: number;
|
94
|
+
/**
|
95
|
+
* JSON format for contract function.
|
96
|
+
* For example: `{ "type":"function", "inputs": [{"name":"a","type":"uint256"}], "name":"foo", "outputs": [] }`.
|
97
|
+
* If exists, the `parameters` will be ignored.
|
98
|
+
* Optional.
|
99
|
+
*/
|
100
|
+
funcABIV2?: AbiFragment;
|
101
|
+
/**
|
102
|
+
* The parameters of the function specified by `funcABIV2`.
|
103
|
+
* Required if `funcABIV2` exists.
|
104
|
+
*/
|
105
|
+
parametersV2?: unknown[];
|
106
|
+
/**
|
107
|
+
* Raw parameters encoded according to [ABI Specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
|
108
|
+
* If exists, the `parametersV2` and `parameters` will be ignored.
|
109
|
+
* For example: 0x0000000000000000000000000000000000000000000000000000000000000001.
|
110
|
+
* Optional.
|
111
|
+
*/
|
112
|
+
shieldedParameter?: string;
|
113
|
+
/**
|
114
|
+
* Alias of `shieldedParameter`. If exists, the `shieldedParameter`, `parametersV2` and `parameters` will be ignored.
|
115
|
+
*/
|
116
|
+
rawParameter?: string;
|
117
|
+
/**
|
118
|
+
* If functionSelector is not specified, this parameter will be used as data.
|
119
|
+
*/
|
120
|
+
input?: string;
|
121
|
+
/**
|
122
|
+
* Create transaction locally.
|
123
|
+
*/
|
124
|
+
txLocal?: boolean;
|
125
|
+
_isConstant?: boolean;
|
126
|
+
/**
|
127
|
+
* If use solidity node to trigger smart contract.
|
128
|
+
*/
|
129
|
+
confirmed?: boolean;
|
130
|
+
}
|
131
|
+
export interface TriggerConstantContractOptions extends TriggerSmartContractOptions {
|
132
|
+
_isConstant?: boolean;
|
133
|
+
/**
|
134
|
+
* Whether the request only aims to estimating energy not trigger contract actually.
|
135
|
+
*/
|
136
|
+
estimateEnergy?: boolean;
|
137
|
+
/**
|
138
|
+
* If use solidity node to trigger smart contract.
|
139
|
+
*/
|
140
|
+
confirmed?: boolean;
|
141
|
+
}
|
142
|
+
export interface ContractFunctionParameter {
|
143
|
+
type: string;
|
144
|
+
value: unknown;
|
145
|
+
}
|
146
|
+
export interface CreateTokenOptions extends TransactionCommonOptions {
|
147
|
+
/**
|
148
|
+
* Token name, default string.
|
149
|
+
*/
|
150
|
+
name: string;
|
151
|
+
/**
|
152
|
+
* Token name abbreviation, default string.
|
153
|
+
*/
|
154
|
+
abbreviation: string;
|
155
|
+
/**
|
156
|
+
* Token description, default string.
|
157
|
+
*/
|
158
|
+
description?: string;
|
159
|
+
/**
|
160
|
+
* Token official website url, default string.
|
161
|
+
*/
|
162
|
+
url: string;
|
163
|
+
/**
|
164
|
+
* Token total supply.
|
165
|
+
*/
|
166
|
+
totalSupply: number;
|
167
|
+
/**
|
168
|
+
* Define the price by the ratio of trx_num/num.
|
169
|
+
* Default is 1.
|
170
|
+
*/
|
171
|
+
trxRatio: number;
|
172
|
+
/**
|
173
|
+
* Define the price by the ratio of trx_num/num.
|
174
|
+
* Default is 1.
|
175
|
+
*/
|
176
|
+
tokenRatio: number;
|
177
|
+
/**
|
178
|
+
* ICO start time.
|
179
|
+
*/
|
180
|
+
saleStart: number;
|
181
|
+
/**
|
182
|
+
* ICO end time.
|
183
|
+
*/
|
184
|
+
saleEnd: number;
|
185
|
+
/**
|
186
|
+
* The creator's "donated" bandwidth for use by token holders.
|
187
|
+
* Default is 0.
|
188
|
+
*/
|
189
|
+
freeBandwidth?: number;
|
190
|
+
/**
|
191
|
+
* Out of `totalFreeBandwidth`, the amount each token holder get.
|
192
|
+
* Default is 0.
|
193
|
+
*/
|
194
|
+
freeBandwidthLimit?: number;
|
195
|
+
/**
|
196
|
+
* Token staked supply.
|
197
|
+
* Default is 0.
|
198
|
+
*/
|
199
|
+
frozenAmount?: number;
|
200
|
+
/**
|
201
|
+
* Token staked duration.
|
202
|
+
* Default is 0.
|
203
|
+
*/
|
204
|
+
frozenDuration?: number;
|
205
|
+
/**
|
206
|
+
* @todo: desc
|
207
|
+
*/
|
208
|
+
voteScore?: number;
|
209
|
+
/**
|
210
|
+
* Precision of issued tokens.
|
211
|
+
*/
|
212
|
+
precision?: number;
|
213
|
+
}
|
214
|
+
export interface UpdateTokenOptions extends TransactionCommonOptions {
|
215
|
+
/**
|
216
|
+
* The description of token.
|
217
|
+
* Optional.
|
218
|
+
*/
|
219
|
+
description?: string;
|
220
|
+
/**
|
221
|
+
* The token's website url.
|
222
|
+
*/
|
223
|
+
url: string;
|
224
|
+
/**
|
225
|
+
* Each token holder's free bandwidth.
|
226
|
+
* Optional.
|
227
|
+
*/
|
228
|
+
freeBandwidth?: number;
|
229
|
+
/**
|
230
|
+
* The total free bandwidth of the token.
|
231
|
+
* Optional. Default is 0.
|
232
|
+
*/
|
233
|
+
freeBandwidthLimit?: number;
|
234
|
+
}
|
235
|
+
export interface DeployConstantContractOptions {
|
236
|
+
/**
|
237
|
+
* The bytecode of contract to be deployed.
|
238
|
+
*/
|
239
|
+
input: string;
|
240
|
+
/**
|
241
|
+
* Owner address of the new contract.
|
242
|
+
*/
|
243
|
+
ownerAddress: string;
|
244
|
+
/**
|
245
|
+
* The id of token to be transfered to the new contract.
|
246
|
+
* Optional.
|
247
|
+
*/
|
248
|
+
tokenId?: string | number;
|
249
|
+
/**
|
250
|
+
* The amount of token to be transfered to the new contract.
|
251
|
+
*/
|
252
|
+
tokenValue?: string | number;
|
253
|
+
/**
|
254
|
+
* Amount of TRX transferred with this transaction, measured in SUN (1TRX = 1,000,000 SUN).
|
255
|
+
*/
|
256
|
+
callValue?: number;
|
257
|
+
/**
|
258
|
+
* Whether send request to solidity node.
|
259
|
+
*/
|
260
|
+
confirmed?: boolean;
|
261
|
+
}
|
262
|
+
export interface AlterTransactionOptions {
|
263
|
+
data?: string;
|
264
|
+
dataFormat?: string;
|
265
|
+
extension?: number;
|
266
|
+
txLocal?: boolean;
|
267
|
+
}
|
268
|
+
export interface TxLocal {
|
269
|
+
txLocal?: boolean;
|
270
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TransactionBuilder.js","sourceRoot":"","sources":["../../../src/types/TransactionBuilder.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { AxiosRequestHeaders } from 'axios';
|
2
|
+
import { BigNumber } from 'bignumber.js';
|
3
|
+
import type { HeadersType } from './Providers.js';
|
4
|
+
import HttpProvider from '../lib/providers/HttpProvider.js';
|
5
|
+
export type IBigNumber = InstanceType<typeof BigNumber>;
|
6
|
+
export interface TronWebOptions {
|
7
|
+
fullNode?: NodeProvider;
|
8
|
+
solidityNode?: NodeProvider;
|
9
|
+
fullHost?: NodeProvider;
|
10
|
+
eventServer?: NodeProvider;
|
11
|
+
headers?: HeadersType;
|
12
|
+
eventHeaders?: AxiosRequestHeaders;
|
13
|
+
privateKey?: string;
|
14
|
+
disablePlugins?: boolean;
|
15
|
+
}
|
16
|
+
export interface DefaultAddress {
|
17
|
+
hex: string | false;
|
18
|
+
base58: string | false;
|
19
|
+
}
|
20
|
+
export type NodeProvider = string | HttpProvider;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TronWeb.js","sourceRoot":"","sources":["../../../src/types/TronWeb.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,263 @@
|
|
1
|
+
import { AccountType, Permission } from './Contract.js';
|
2
|
+
import { SignedTransaction, Transaction } from './Transaction.js';
|
3
|
+
import { Resource } from './TransactionBuilder.js';
|
4
|
+
type HTTPMap<T extends string | number | symbol, U> = Record<T, U>[];
|
5
|
+
export interface FrozenSupply {
|
6
|
+
frozen_amount: number;
|
7
|
+
frozen_days: number;
|
8
|
+
}
|
9
|
+
export interface Token {
|
10
|
+
id: string;
|
11
|
+
owner_address: string;
|
12
|
+
name: string;
|
13
|
+
abbr: string;
|
14
|
+
total_supply: number;
|
15
|
+
frozen_supply: FrozenSupply[];
|
16
|
+
trx_num: number;
|
17
|
+
precision: number;
|
18
|
+
num: number;
|
19
|
+
start_time: number;
|
20
|
+
end_time: number;
|
21
|
+
order: number;
|
22
|
+
vote_score: number;
|
23
|
+
description: string;
|
24
|
+
url: string;
|
25
|
+
free_asset_net_limit: number;
|
26
|
+
public_free_asset_net_limit: number;
|
27
|
+
public_free_asset_net_usage: number;
|
28
|
+
public_latest_free_net_time: number;
|
29
|
+
}
|
30
|
+
export interface Frozen {
|
31
|
+
frozen_balance: number;
|
32
|
+
expire_time: number;
|
33
|
+
}
|
34
|
+
export interface Vote {
|
35
|
+
vote_address: string;
|
36
|
+
vote_count: number;
|
37
|
+
}
|
38
|
+
export interface AccountResource {
|
39
|
+
energy_usage: number;
|
40
|
+
frozen_balance_for_energy: Frozen;
|
41
|
+
latest_consume_time_for_energy: number;
|
42
|
+
acquired_delegated_frozen_balance_for_energy: number;
|
43
|
+
delegated_frozen_balance_for_energy: number;
|
44
|
+
storage_limit: number;
|
45
|
+
storage_usage: number;
|
46
|
+
latest_exchange_storage_time: number;
|
47
|
+
energy_window_size: number;
|
48
|
+
delegated_frozenV2_balance_for_energy: number;
|
49
|
+
acquired_delegated_frozenV2_balance_for_energy: number;
|
50
|
+
energy_window_optimized: boolean;
|
51
|
+
}
|
52
|
+
export declare enum ResourceCode {
|
53
|
+
BANDWIDTH = 0,
|
54
|
+
ENERGY = 1,
|
55
|
+
TRON_POWER = 2
|
56
|
+
}
|
57
|
+
export interface FreezeV2 {
|
58
|
+
type: Resource;
|
59
|
+
amount: number;
|
60
|
+
}
|
61
|
+
export interface UnFreezeV2 {
|
62
|
+
type: Resource;
|
63
|
+
unfreeze_amount: number;
|
64
|
+
unfreeze_expire_time: number;
|
65
|
+
}
|
66
|
+
export interface Account {
|
67
|
+
account_name: string;
|
68
|
+
type: AccountType;
|
69
|
+
address: string;
|
70
|
+
balance: number;
|
71
|
+
votes: Vote[];
|
72
|
+
asset: HTTPMap<string, number>;
|
73
|
+
assetV2: HTTPMap<string, number>;
|
74
|
+
frozen: Frozen[];
|
75
|
+
net_usage: number;
|
76
|
+
acquired_delegated_frozen_balance_for_bandwidth: number;
|
77
|
+
delegated_frozen_balance_for_bandwidth: number;
|
78
|
+
old_tron_power: number;
|
79
|
+
tron_power: Frozen;
|
80
|
+
asset_optimized: boolean;
|
81
|
+
create_time: number;
|
82
|
+
latest_opration_time: number;
|
83
|
+
allowance: number;
|
84
|
+
latest_withdraw_time: number;
|
85
|
+
code: string;
|
86
|
+
is_witness: boolean;
|
87
|
+
is_committee: boolean;
|
88
|
+
frozen_supply: Frozen;
|
89
|
+
asset_issued_name: string;
|
90
|
+
asset_issued_ID: string;
|
91
|
+
latest_asset_operation_time: HTTPMap<string, number>;
|
92
|
+
latest_asset_operation_timeV2: HTTPMap<string, number>;
|
93
|
+
free_net_usage: number;
|
94
|
+
free_asset_net_usage: HTTPMap<string, number>;
|
95
|
+
free_asset_net_usageV2: HTTPMap<string, number>;
|
96
|
+
latest_consume_time: number;
|
97
|
+
latest_consume_free_time: number;
|
98
|
+
account_id: string;
|
99
|
+
net_window_size: number;
|
100
|
+
net_window_optimized: number;
|
101
|
+
account_resource: AccountResource;
|
102
|
+
codeHash: string;
|
103
|
+
owner_permission: Permission;
|
104
|
+
witness_permission: Permission;
|
105
|
+
active_permission: Permission[];
|
106
|
+
frozenV2: FreezeV2[];
|
107
|
+
unfrozenV2: UnFreezeV2[];
|
108
|
+
delegated_frozenV2_balance_for_bandwidth: number;
|
109
|
+
acquired_delegated_frozenV2_balance_for_bandwidth: number;
|
110
|
+
}
|
111
|
+
export interface AccountNetMessage {
|
112
|
+
freeNetUsed: number;
|
113
|
+
freeNetLimit: number;
|
114
|
+
NetUsed: number;
|
115
|
+
NetLimit: number;
|
116
|
+
assetNetUsed: HTTPMap<string, number>;
|
117
|
+
assetNetLimit: HTTPMap<string, number>;
|
118
|
+
TotalNetLimit: number;
|
119
|
+
TotalNetWeight: number;
|
120
|
+
}
|
121
|
+
export interface Witness {
|
122
|
+
address: string;
|
123
|
+
voteCount: number;
|
124
|
+
pubKey: string;
|
125
|
+
url: string;
|
126
|
+
totalProduced: number;
|
127
|
+
totalMissed: number;
|
128
|
+
latestBlockNum: number;
|
129
|
+
latestSlotNum: number;
|
130
|
+
isJobs: boolean;
|
131
|
+
}
|
132
|
+
declare enum TransactionSignWeight_response_code {
|
133
|
+
ENOUGH_PERMISSION = "ENOUGH_PERMISSION",
|
134
|
+
NOT_ENOUGH_PERMISSION = "NOT_ENOUGH_PERMISSION",// error in
|
135
|
+
SIGNATURE_FORMAT_ERROR = "SIGNATURE_FORMAT_ERROR",
|
136
|
+
COMPUTE_ADDRESS_ERROR = "COMPUTE_ADDRESS_ERROR",
|
137
|
+
PERMISSION_ERROR = "PERMISSION_ERROR",//The key is not in permission
|
138
|
+
OTHER_ERROR = "OTHER_ERROR"
|
139
|
+
}
|
140
|
+
interface TransactionSignWeightResult {
|
141
|
+
code: TransactionSignWeight_response_code;
|
142
|
+
message: string;
|
143
|
+
}
|
144
|
+
export interface TransactionSignWeight {
|
145
|
+
permission: Permission;
|
146
|
+
approved_list: string[];
|
147
|
+
current_weight: number;
|
148
|
+
result: TransactionSignWeightResult;
|
149
|
+
transaction: {
|
150
|
+
transaction: Transaction;
|
151
|
+
};
|
152
|
+
}
|
153
|
+
declare enum BroadcastReturn_response_code {
|
154
|
+
SUCCESS = 0,
|
155
|
+
SIGERROR = 1,// error in signature
|
156
|
+
CONTRACT_VALIDATE_ERROR = 2,
|
157
|
+
CONTRACT_EXE_ERROR = 3,
|
158
|
+
BANDWITH_ERROR = 4,
|
159
|
+
DUP_TRANSACTION_ERROR = 5,
|
160
|
+
TAPOS_ERROR = 6,
|
161
|
+
TOO_BIG_TRANSACTION_ERROR = 7,
|
162
|
+
TRANSACTION_EXPIRATION_ERROR = 8,
|
163
|
+
SERVER_BUSY = 9,
|
164
|
+
NO_CONNECTION = 10,
|
165
|
+
NOT_ENOUGH_EFFECTIVE_CONNECTION = 11,
|
166
|
+
OTHER_ERROR = 20
|
167
|
+
}
|
168
|
+
export interface BroadcastReturn<T extends SignedTransaction> {
|
169
|
+
result: boolean;
|
170
|
+
code: BroadcastReturn_response_code;
|
171
|
+
message: string;
|
172
|
+
transaction: T;
|
173
|
+
}
|
174
|
+
export interface BroadcastHexReturn {
|
175
|
+
result: boolean;
|
176
|
+
txid: string;
|
177
|
+
code: string;
|
178
|
+
message: string;
|
179
|
+
transaction: string;
|
180
|
+
}
|
181
|
+
export interface AddressOptions {
|
182
|
+
privateKey?: string;
|
183
|
+
address?: string;
|
184
|
+
}
|
185
|
+
declare enum ProposalState {
|
186
|
+
PENDING = 0,
|
187
|
+
DISAPPROVED = 1,
|
188
|
+
APPROVED = 2,
|
189
|
+
CANCELED = 3
|
190
|
+
}
|
191
|
+
export interface Proposal {
|
192
|
+
proposal_id: number;
|
193
|
+
proposer_address: string;
|
194
|
+
parameters: HTTPMap<number, number>;
|
195
|
+
expiration_time: number;
|
196
|
+
create_time: number;
|
197
|
+
approvals: string[];
|
198
|
+
state: ProposalState;
|
199
|
+
}
|
200
|
+
export interface ChainParameter {
|
201
|
+
key: string;
|
202
|
+
value: number;
|
203
|
+
}
|
204
|
+
export interface AccountResourceMessage {
|
205
|
+
freeNetUsed: number;
|
206
|
+
freeNetLimit: number;
|
207
|
+
NetUsed: number;
|
208
|
+
NetLimit: number;
|
209
|
+
assetNetUsed: HTTPMap<string, number>;
|
210
|
+
assetNetLimit: HTTPMap<string, number>;
|
211
|
+
TotalNetLimit: number;
|
212
|
+
TotalNetWeight: number;
|
213
|
+
TotalTronPowerWeight: number;
|
214
|
+
tronPowerUsed: number;
|
215
|
+
tronPowerLimit: number;
|
216
|
+
EnergyUsed: number;
|
217
|
+
EnergyLimit: number;
|
218
|
+
TotalEnergyLimit: number;
|
219
|
+
TotalEnergyWeight: number;
|
220
|
+
storageUsed: number;
|
221
|
+
storageLimit: number;
|
222
|
+
}
|
223
|
+
export type Address = string;
|
224
|
+
export interface Exchange {
|
225
|
+
exchange_id: number;
|
226
|
+
creator_address: Address;
|
227
|
+
create_time: number;
|
228
|
+
first_token_id: string;
|
229
|
+
first_token_balance: number;
|
230
|
+
second_token_id: string;
|
231
|
+
second_token_balance: number;
|
232
|
+
}
|
233
|
+
export interface TransactionInfo {
|
234
|
+
id: string;
|
235
|
+
fee: number;
|
236
|
+
blockNumber: number;
|
237
|
+
blockTimeStamp: number;
|
238
|
+
contractResult: string[];
|
239
|
+
contract_address: string;
|
240
|
+
receipt: {
|
241
|
+
energy_usage: number;
|
242
|
+
energy_fee: number;
|
243
|
+
origin_energy_usage: number;
|
244
|
+
energy_usage_total: number;
|
245
|
+
net_usage: number;
|
246
|
+
net_fee: number;
|
247
|
+
result: string;
|
248
|
+
energy_penalty_total: number;
|
249
|
+
};
|
250
|
+
log: {
|
251
|
+
address: Address;
|
252
|
+
topics: string[];
|
253
|
+
data: string;
|
254
|
+
}[];
|
255
|
+
result?: 'FAILED';
|
256
|
+
resMessage: string;
|
257
|
+
withdraw_amount: number;
|
258
|
+
unfreeze_amount: number;
|
259
|
+
withdraw_expire_amount: number;
|
260
|
+
cancel_unfreezeV2_amount: HTTPMap<string, number>;
|
261
|
+
exchange_id: string;
|
262
|
+
}
|
263
|
+
export {};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
export var ResourceCode;
|
2
|
+
(function (ResourceCode) {
|
3
|
+
ResourceCode[ResourceCode["BANDWIDTH"] = 0] = "BANDWIDTH";
|
4
|
+
ResourceCode[ResourceCode["ENERGY"] = 1] = "ENERGY";
|
5
|
+
ResourceCode[ResourceCode["TRON_POWER"] = 2] = "TRON_POWER";
|
6
|
+
})(ResourceCode || (ResourceCode = {}));
|
7
|
+
var TransactionSignWeight_response_code;
|
8
|
+
(function (TransactionSignWeight_response_code) {
|
9
|
+
TransactionSignWeight_response_code["ENOUGH_PERMISSION"] = "ENOUGH_PERMISSION";
|
10
|
+
TransactionSignWeight_response_code["NOT_ENOUGH_PERMISSION"] = "NOT_ENOUGH_PERMISSION";
|
11
|
+
TransactionSignWeight_response_code["SIGNATURE_FORMAT_ERROR"] = "SIGNATURE_FORMAT_ERROR";
|
12
|
+
TransactionSignWeight_response_code["COMPUTE_ADDRESS_ERROR"] = "COMPUTE_ADDRESS_ERROR";
|
13
|
+
TransactionSignWeight_response_code["PERMISSION_ERROR"] = "PERMISSION_ERROR";
|
14
|
+
TransactionSignWeight_response_code["OTHER_ERROR"] = "OTHER_ERROR";
|
15
|
+
})(TransactionSignWeight_response_code || (TransactionSignWeight_response_code = {}));
|
16
|
+
var BroadcastReturn_response_code;
|
17
|
+
(function (BroadcastReturn_response_code) {
|
18
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["SUCCESS"] = 0] = "SUCCESS";
|
19
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["SIGERROR"] = 1] = "SIGERROR";
|
20
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["CONTRACT_VALIDATE_ERROR"] = 2] = "CONTRACT_VALIDATE_ERROR";
|
21
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["CONTRACT_EXE_ERROR"] = 3] = "CONTRACT_EXE_ERROR";
|
22
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["BANDWITH_ERROR"] = 4] = "BANDWITH_ERROR";
|
23
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["DUP_TRANSACTION_ERROR"] = 5] = "DUP_TRANSACTION_ERROR";
|
24
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["TAPOS_ERROR"] = 6] = "TAPOS_ERROR";
|
25
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["TOO_BIG_TRANSACTION_ERROR"] = 7] = "TOO_BIG_TRANSACTION_ERROR";
|
26
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["TRANSACTION_EXPIRATION_ERROR"] = 8] = "TRANSACTION_EXPIRATION_ERROR";
|
27
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["SERVER_BUSY"] = 9] = "SERVER_BUSY";
|
28
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["NO_CONNECTION"] = 10] = "NO_CONNECTION";
|
29
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["NOT_ENOUGH_EFFECTIVE_CONNECTION"] = 11] = "NOT_ENOUGH_EFFECTIVE_CONNECTION";
|
30
|
+
BroadcastReturn_response_code[BroadcastReturn_response_code["OTHER_ERROR"] = 20] = "OTHER_ERROR";
|
31
|
+
})(BroadcastReturn_response_code || (BroadcastReturn_response_code = {}));
|
32
|
+
var ProposalState;
|
33
|
+
(function (ProposalState) {
|
34
|
+
ProposalState[ProposalState["PENDING"] = 0] = "PENDING";
|
35
|
+
ProposalState[ProposalState["DISAPPROVED"] = 1] = "DISAPPROVED";
|
36
|
+
ProposalState[ProposalState["APPROVED"] = 2] = "APPROVED";
|
37
|
+
ProposalState[ProposalState["CANCELED"] = 3] = "CANCELED";
|
38
|
+
})(ProposalState || (ProposalState = {}));
|
39
|
+
//# sourceMappingURL=Trx.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Trx.js","sourceRoot":"","sources":["../../../src/types/Trx.ts"],"names":[],"mappings":"AA0DA,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,yDAAgB,CAAA;IAChB,mDAAa,CAAA;IACb,2DAAiB,CAAA;AACrB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAiFD,IAAK,mCAOJ;AAPD,WAAK,mCAAmC;IACpC,8EAAuC,CAAA;IACvC,sFAA+C,CAAA;IAC/C,wFAAiD,CAAA;IACjD,sFAA+C,CAAA;IAC/C,4EAAqC,CAAA;IACrC,kEAA2B,CAAA;AAC/B,CAAC,EAPI,mCAAmC,KAAnC,mCAAmC,QAOvC;AAeD,IAAK,6BAcJ;AAdD,WAAK,6BAA6B;IAC9B,uFAAW,CAAA;IACX,yFAAY,CAAA;IACZ,uHAA2B,CAAA;IAC3B,6GAAsB,CAAA;IACtB,qGAAkB,CAAA;IAClB,mHAAyB,CAAA;IACzB,+FAAe,CAAA;IACf,2HAA6B,CAAA;IAC7B,iIAAgC,CAAA;IAChC,+FAAe,CAAA;IACf,oGAAkB,CAAA;IAClB,wIAAoC,CAAA;IACpC,gGAAgB,CAAA;AACpB,CAAC,EAdI,6BAA6B,KAA7B,6BAA6B,QAcjC;AAsBD,IAAK,aAKJ;AALD,WAAK,aAAa;IACd,uDAAW,CAAA;IACX,+DAAe,CAAA;IACf,yDAAY,CAAA;IACZ,yDAAY,CAAA;AAChB,CAAC,EALI,aAAa,KAAb,aAAa,QAKjB"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
export type BytesLike = number[] | Uint8Array;
|
2
|
+
export type EventQueryDataType = {
|
3
|
+
block_number: number;
|
4
|
+
block_timestamp: number;
|
5
|
+
contract_address: string;
|
6
|
+
event_name: string;
|
7
|
+
transaction_id: string;
|
8
|
+
result: unknown;
|
9
|
+
resource_Node: string;
|
10
|
+
_unconfirmed?: boolean;
|
11
|
+
_fingerprint?: string | undefined;
|
12
|
+
};
|
13
|
+
export type MapEventQueryDataType = {
|
14
|
+
block: number;
|
15
|
+
timestamp: number;
|
16
|
+
contract: string;
|
17
|
+
name: string;
|
18
|
+
transaction: string;
|
19
|
+
result: unknown;
|
20
|
+
resourceNode: string;
|
21
|
+
unconfirmed?: boolean;
|
22
|
+
fingerprint?: string | undefined;
|
23
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"UtilsTypes.js","sourceRoot":"","sources":["../../../src/types/UtilsTypes.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export * from './ABI.js';
|
2
|
+
export * from './APIResponse.js';
|
3
|
+
export * from './Contract.js';
|
4
|
+
export * from './Providers.js';
|
5
|
+
export * from './Transaction.js';
|
6
|
+
export * from './TransactionBuilder.js';
|
7
|
+
export * from './TronWeb.js';
|
8
|
+
export * from './Trx.js';
|
9
|
+
export * from './UtilsTypes.js';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export * from './ABI.js';
|
2
|
+
export * from './APIResponse.js';
|
3
|
+
export * from './Contract.js';
|
4
|
+
export * from './Providers.js';
|
5
|
+
export * from './Transaction.js';
|
6
|
+
export * from './TransactionBuilder.js';
|
7
|
+
export * from './TronWeb.js';
|
8
|
+
export * from './Trx.js';
|
9
|
+
export * from './UtilsTypes.js';
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { FunctionFragment, AbiInputsType } from '../types/ABI.js';
|
2
|
+
export declare function decodeParams(names: string[], types: string[], output: string, ignoreMethodHash?: boolean): any;
|
3
|
+
export declare function encodeParams(types: string[], values: any[]): string;
|
4
|
+
export declare function encodeParamsV2ByABI(funABI: FunctionFragment, args: any[]): string;
|
5
|
+
export declare function decodeParamsV2ByABI(funABI: FunctionFragment | AbiInputsType, data: string | Uint8Array): any[];
|