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,287 @@
|
|
1
|
+
import { Resource } from '../types/TransactionBuilder.js';
|
2
|
+
import { ContractAbiInterface } from './ABI.js';
|
3
|
+
export declare enum ContractType {
|
4
|
+
AccountCreateContract = "AccountCreateContract",
|
5
|
+
TransferContract = "TransferContract",
|
6
|
+
TransferAssetContract = "TransferAssetContract",
|
7
|
+
VoteAssetContract = "VoteAssetContract",
|
8
|
+
VoteWitnessContract = "VoteWitnessContract",
|
9
|
+
WitnessCreateContract = "WitnessCreateContract",
|
10
|
+
AssetIssueContract = "AssetIssueContract",
|
11
|
+
WitnessUpdateContract = "WitnessUpdateContract",
|
12
|
+
ParticipateAssetIssueContract = "ParticipateAssetIssueContract",
|
13
|
+
AccountUpdateContract = "AccountUpdateContract",
|
14
|
+
FreezeBalanceContract = "FreezeBalanceContract",
|
15
|
+
UnfreezeBalanceContract = "UnfreezeBalanceContract",
|
16
|
+
CancelAllUnfreezeV2Contract = "CancelAllUnfreezeV2Contract",
|
17
|
+
WithdrawBalanceContract = "WithdrawBalanceContract",
|
18
|
+
UnfreezeAssetContract = "UnfreezeAssetContract",
|
19
|
+
UpdateAssetContract = "UpdateAssetContract",
|
20
|
+
ProposalCreateContract = "ProposalCreateContract",
|
21
|
+
ProposalApproveContract = "ProposalApproveContract",
|
22
|
+
ProposalDeleteContract = "ProposalDeleteContract",
|
23
|
+
SetAccountIdContract = "SetAccountIdContract",
|
24
|
+
CustomContract = "CustomContract",
|
25
|
+
CreateSmartContract = "CreateSmartContract",
|
26
|
+
TriggerSmartContract = "TriggerSmartContract",
|
27
|
+
GetContract = "GetContract",
|
28
|
+
UpdateSettingContract = "UpdateSettingContract",
|
29
|
+
ExchangeCreateContract = "ExchangeCreateContract",
|
30
|
+
ExchangeInjectContract = "ExchangeInjectContract",
|
31
|
+
ExchangeWithdrawContract = "ExchangeWithdrawContract",
|
32
|
+
ExchangeTransactionContract = "ExchangeTransactionContract",
|
33
|
+
UpdateEnergyLimitContract = "UpdateEnergyLimitContract",
|
34
|
+
AccountPermissionUpdateContract = "AccountPermissionUpdateContract",
|
35
|
+
ClearABIContract = "ClearABIContract",
|
36
|
+
UpdateBrokerageContract = "UpdateBrokerageContract",
|
37
|
+
ShieldedTransferContract = "ShieldedTransferContract",
|
38
|
+
MarketSellAssetContract = "MarketSellAssetContract",
|
39
|
+
MarketCancelOrderContract = "MarketCancelOrderContract",
|
40
|
+
FreezeBalanceV2Contract = "FreezeBalanceV2Contract",
|
41
|
+
UnfreezeBalanceV2Contract = "UnfreezeBalanceV2Contract",
|
42
|
+
WithdrawExpireUnfreezeContract = "WithdrawExpireUnfreezeContract",
|
43
|
+
DelegateResourceContract = "DelegateResourceContract",
|
44
|
+
UnDelegateResourceContract = "UnDelegateResourceContract",
|
45
|
+
UNRECOGNIZED = "UNRECOGNIZED"
|
46
|
+
}
|
47
|
+
export declare enum Permission_PermissionType {
|
48
|
+
Owner = 0,
|
49
|
+
Witness = 1,
|
50
|
+
Active = 2,
|
51
|
+
UNRECOGNIZED = -1
|
52
|
+
}
|
53
|
+
export interface Key {
|
54
|
+
address: Uint8Array;
|
55
|
+
weight: number;
|
56
|
+
}
|
57
|
+
export declare enum AccountType {
|
58
|
+
Normal = 0,
|
59
|
+
AssetIssue = 1,
|
60
|
+
Contract = 2,
|
61
|
+
UNRECOGNIZED = -1
|
62
|
+
}
|
63
|
+
export interface PermissionKey {
|
64
|
+
address: string;
|
65
|
+
weight: number;
|
66
|
+
}
|
67
|
+
export interface Permission {
|
68
|
+
type: number;
|
69
|
+
/** Owner id=0, Witness id=1, Active id start by 2 */
|
70
|
+
id?: number;
|
71
|
+
permission_name: string;
|
72
|
+
threshold: number;
|
73
|
+
operations?: string;
|
74
|
+
keys: PermissionKey[];
|
75
|
+
}
|
76
|
+
export interface TransferContract {
|
77
|
+
to_address: string;
|
78
|
+
owner_address: string;
|
79
|
+
amount: number;
|
80
|
+
}
|
81
|
+
export interface TransferAssetContract {
|
82
|
+
to_address: string;
|
83
|
+
owner_address: string;
|
84
|
+
amount: number;
|
85
|
+
asset_name: string;
|
86
|
+
}
|
87
|
+
export interface ParticipateAssetIssueContract {
|
88
|
+
to_address: string;
|
89
|
+
owner_address: string;
|
90
|
+
asset_name: string;
|
91
|
+
amount: number;
|
92
|
+
}
|
93
|
+
export interface TriggerSmartContract {
|
94
|
+
owner_address: string;
|
95
|
+
contract_address: string;
|
96
|
+
call_value?: number;
|
97
|
+
call_token_value?: number;
|
98
|
+
token_id?: number;
|
99
|
+
data?: string;
|
100
|
+
}
|
101
|
+
export interface FreezeBalanceContract {
|
102
|
+
owner_address: string;
|
103
|
+
frozen_balance: number;
|
104
|
+
frozen_duration: number;
|
105
|
+
resource?: Resource;
|
106
|
+
receiver_address?: string;
|
107
|
+
}
|
108
|
+
export interface UnfreezeBalanceContract {
|
109
|
+
owner_address: string;
|
110
|
+
resource: string;
|
111
|
+
receiver_address: string;
|
112
|
+
}
|
113
|
+
export interface WithdrawBalanceContract {
|
114
|
+
owner_address: string;
|
115
|
+
}
|
116
|
+
export interface FreezeBalanceV2Contract {
|
117
|
+
owner_address: string;
|
118
|
+
frozen_balance: number;
|
119
|
+
resource?: Resource;
|
120
|
+
}
|
121
|
+
export interface CancelFreezeBalanceV2Contract {
|
122
|
+
owner_address: string;
|
123
|
+
}
|
124
|
+
export interface UnfreezeBalanceV2Contract {
|
125
|
+
owner_address: string;
|
126
|
+
unfreeze_balance: number;
|
127
|
+
resource?: Resource;
|
128
|
+
}
|
129
|
+
export interface DelegateResourceContract {
|
130
|
+
owner_address: string;
|
131
|
+
receiver_address: string;
|
132
|
+
balance: number;
|
133
|
+
resource?: Resource;
|
134
|
+
lock?: boolean;
|
135
|
+
lock_period?: number;
|
136
|
+
}
|
137
|
+
export interface UnDelegateResourceContract {
|
138
|
+
owner_address: string;
|
139
|
+
receiver_address: string;
|
140
|
+
balance: number;
|
141
|
+
resource?: Resource;
|
142
|
+
}
|
143
|
+
export interface WithdrawExpireUnfreezeContract {
|
144
|
+
owner_address: string;
|
145
|
+
}
|
146
|
+
export interface CreateSmartContract {
|
147
|
+
owner_address: string;
|
148
|
+
call_token_value: number;
|
149
|
+
token_id: string;
|
150
|
+
new_contract: {
|
151
|
+
name: string;
|
152
|
+
origin_address: string;
|
153
|
+
contract_address: string;
|
154
|
+
abi: {
|
155
|
+
entrys?: ContractAbiInterface;
|
156
|
+
};
|
157
|
+
bytecode: string;
|
158
|
+
call_value: number;
|
159
|
+
consume_user_resource_percent: number;
|
160
|
+
origin_energy_limit: number;
|
161
|
+
};
|
162
|
+
}
|
163
|
+
export interface DeployConstantContract {
|
164
|
+
data: string;
|
165
|
+
owner_address: string;
|
166
|
+
call_value?: number;
|
167
|
+
token_id?: number | string;
|
168
|
+
call_token_value?: number | string;
|
169
|
+
}
|
170
|
+
export interface ClearABIContract {
|
171
|
+
contract_address: string;
|
172
|
+
owner_address: string;
|
173
|
+
}
|
174
|
+
export interface UpdateBrokerageContract {
|
175
|
+
brokerage: number;
|
176
|
+
owner_address: string;
|
177
|
+
}
|
178
|
+
interface FrozenSupply {
|
179
|
+
frozen_amount: number;
|
180
|
+
frozen_days: number;
|
181
|
+
}
|
182
|
+
export interface AssetIssueContract {
|
183
|
+
owner_address: string;
|
184
|
+
name: string;
|
185
|
+
abbr: string;
|
186
|
+
description: string;
|
187
|
+
url: string;
|
188
|
+
total_supply: number;
|
189
|
+
trx_num: number;
|
190
|
+
num: number;
|
191
|
+
start_time: number;
|
192
|
+
end_time: number;
|
193
|
+
precision: number;
|
194
|
+
free_asset_net_limit: number;
|
195
|
+
public_free_asset_net_limit: number;
|
196
|
+
public_free_asset_net_usage: number;
|
197
|
+
public_latest_free_net_time: number;
|
198
|
+
vote_score: number;
|
199
|
+
frozen_supply: FrozenSupply[];
|
200
|
+
}
|
201
|
+
export interface AccountCreateContract {
|
202
|
+
account_address: string;
|
203
|
+
owner_address: string;
|
204
|
+
}
|
205
|
+
export interface AccountUpdateContract {
|
206
|
+
account_name: string;
|
207
|
+
owner_address: string;
|
208
|
+
}
|
209
|
+
export interface SetAccountIdContract {
|
210
|
+
account_id: string;
|
211
|
+
owner_address: string;
|
212
|
+
}
|
213
|
+
export interface ProposalCreateContract {
|
214
|
+
owner_address: string;
|
215
|
+
parameters: Record<string, string | number>[];
|
216
|
+
}
|
217
|
+
export interface ProposalDeleteContract {
|
218
|
+
owner_address: string;
|
219
|
+
proposal_id: number;
|
220
|
+
}
|
221
|
+
export interface VoteProposalContract {
|
222
|
+
owner_address: string;
|
223
|
+
proposal_id: number;
|
224
|
+
is_add_approval: boolean;
|
225
|
+
}
|
226
|
+
export interface ExchangeCreateContract {
|
227
|
+
owner_address: string;
|
228
|
+
first_token_id: string;
|
229
|
+
first_token_balance: number;
|
230
|
+
second_token_id: string;
|
231
|
+
second_token_balance: number;
|
232
|
+
}
|
233
|
+
export interface ExchangeInjectContract {
|
234
|
+
owner_address: string;
|
235
|
+
exchange_id: number;
|
236
|
+
token_id: string;
|
237
|
+
quant: number;
|
238
|
+
}
|
239
|
+
export interface ExchangeWithdrawContract {
|
240
|
+
owner_address: string;
|
241
|
+
exchange_id: number;
|
242
|
+
token_id: string;
|
243
|
+
quant: number;
|
244
|
+
}
|
245
|
+
export interface ExchangeTransactionContract {
|
246
|
+
owner_address: string;
|
247
|
+
exchange_id: number;
|
248
|
+
token_id: string;
|
249
|
+
quant: number;
|
250
|
+
expected: number;
|
251
|
+
}
|
252
|
+
export interface UpdateSettingContract {
|
253
|
+
owner_address: string;
|
254
|
+
contract_address: string;
|
255
|
+
consume_user_resource_percent: number;
|
256
|
+
}
|
257
|
+
export interface UpdateEnergyLimitContract {
|
258
|
+
owner_address: string;
|
259
|
+
contract_address: string;
|
260
|
+
origin_energy_limit: number;
|
261
|
+
}
|
262
|
+
export interface AccountPermissionUpdateContract {
|
263
|
+
owner_address: string;
|
264
|
+
owner?: Permission;
|
265
|
+
witness?: Permission;
|
266
|
+
actives?: Permission[];
|
267
|
+
}
|
268
|
+
export interface UpdateAssetContract {
|
269
|
+
owner_address: string;
|
270
|
+
description: string;
|
271
|
+
url: string;
|
272
|
+
new_limit?: number;
|
273
|
+
new_public_limit?: number;
|
274
|
+
}
|
275
|
+
export interface WitnessCreateContract {
|
276
|
+
owner_address: string;
|
277
|
+
url: string;
|
278
|
+
}
|
279
|
+
export interface VoteWitnessContract {
|
280
|
+
owner_address: string;
|
281
|
+
votes: {
|
282
|
+
vote_address: string;
|
283
|
+
vote_count: number;
|
284
|
+
}[];
|
285
|
+
}
|
286
|
+
export type ContractParamter = TransferContract | TransferAssetContract | ParticipateAssetIssueContract | TriggerSmartContract | FreezeBalanceContract | UnfreezeBalanceContract | WithdrawBalanceContract | FreezeBalanceV2Contract | CancelFreezeBalanceV2Contract | UnfreezeBalanceV2Contract | DelegateResourceContract | UnDelegateResourceContract | WithdrawExpireUnfreezeContract | CreateSmartContract | ClearABIContract | UpdateBrokerageContract | AssetIssueContract | AccountCreateContract | AccountUpdateContract | SetAccountIdContract | ProposalCreateContract | ProposalDeleteContract | VoteProposalContract | ExchangeCreateContract | ExchangeInjectContract | ExchangeWithdrawContract | ExchangeTransactionContract | UpdateSettingContract | UpdateEnergyLimitContract | AccountPermissionUpdateContract | UpdateAssetContract | WitnessCreateContract | VoteWitnessContract;
|
287
|
+
export {};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AccountType = exports.Permission_PermissionType = exports.ContractType = void 0;
|
4
|
+
var ContractType;
|
5
|
+
(function (ContractType) {
|
6
|
+
ContractType["AccountCreateContract"] = "AccountCreateContract";
|
7
|
+
ContractType["TransferContract"] = "TransferContract";
|
8
|
+
ContractType["TransferAssetContract"] = "TransferAssetContract";
|
9
|
+
ContractType["VoteAssetContract"] = "VoteAssetContract";
|
10
|
+
ContractType["VoteWitnessContract"] = "VoteWitnessContract";
|
11
|
+
ContractType["WitnessCreateContract"] = "WitnessCreateContract";
|
12
|
+
ContractType["AssetIssueContract"] = "AssetIssueContract";
|
13
|
+
ContractType["WitnessUpdateContract"] = "WitnessUpdateContract";
|
14
|
+
ContractType["ParticipateAssetIssueContract"] = "ParticipateAssetIssueContract";
|
15
|
+
ContractType["AccountUpdateContract"] = "AccountUpdateContract";
|
16
|
+
ContractType["FreezeBalanceContract"] = "FreezeBalanceContract";
|
17
|
+
ContractType["UnfreezeBalanceContract"] = "UnfreezeBalanceContract";
|
18
|
+
ContractType["CancelAllUnfreezeV2Contract"] = "CancelAllUnfreezeV2Contract";
|
19
|
+
ContractType["WithdrawBalanceContract"] = "WithdrawBalanceContract";
|
20
|
+
ContractType["UnfreezeAssetContract"] = "UnfreezeAssetContract";
|
21
|
+
ContractType["UpdateAssetContract"] = "UpdateAssetContract";
|
22
|
+
ContractType["ProposalCreateContract"] = "ProposalCreateContract";
|
23
|
+
ContractType["ProposalApproveContract"] = "ProposalApproveContract";
|
24
|
+
ContractType["ProposalDeleteContract"] = "ProposalDeleteContract";
|
25
|
+
ContractType["SetAccountIdContract"] = "SetAccountIdContract";
|
26
|
+
ContractType["CustomContract"] = "CustomContract";
|
27
|
+
ContractType["CreateSmartContract"] = "CreateSmartContract";
|
28
|
+
ContractType["TriggerSmartContract"] = "TriggerSmartContract";
|
29
|
+
ContractType["GetContract"] = "GetContract";
|
30
|
+
ContractType["UpdateSettingContract"] = "UpdateSettingContract";
|
31
|
+
ContractType["ExchangeCreateContract"] = "ExchangeCreateContract";
|
32
|
+
ContractType["ExchangeInjectContract"] = "ExchangeInjectContract";
|
33
|
+
ContractType["ExchangeWithdrawContract"] = "ExchangeWithdrawContract";
|
34
|
+
ContractType["ExchangeTransactionContract"] = "ExchangeTransactionContract";
|
35
|
+
ContractType["UpdateEnergyLimitContract"] = "UpdateEnergyLimitContract";
|
36
|
+
ContractType["AccountPermissionUpdateContract"] = "AccountPermissionUpdateContract";
|
37
|
+
ContractType["ClearABIContract"] = "ClearABIContract";
|
38
|
+
ContractType["UpdateBrokerageContract"] = "UpdateBrokerageContract";
|
39
|
+
ContractType["ShieldedTransferContract"] = "ShieldedTransferContract";
|
40
|
+
ContractType["MarketSellAssetContract"] = "MarketSellAssetContract";
|
41
|
+
ContractType["MarketCancelOrderContract"] = "MarketCancelOrderContract";
|
42
|
+
ContractType["FreezeBalanceV2Contract"] = "FreezeBalanceV2Contract";
|
43
|
+
ContractType["UnfreezeBalanceV2Contract"] = "UnfreezeBalanceV2Contract";
|
44
|
+
ContractType["WithdrawExpireUnfreezeContract"] = "WithdrawExpireUnfreezeContract";
|
45
|
+
ContractType["DelegateResourceContract"] = "DelegateResourceContract";
|
46
|
+
ContractType["UnDelegateResourceContract"] = "UnDelegateResourceContract";
|
47
|
+
ContractType["UNRECOGNIZED"] = "UNRECOGNIZED";
|
48
|
+
})(ContractType || (exports.ContractType = ContractType = {}));
|
49
|
+
var Permission_PermissionType;
|
50
|
+
(function (Permission_PermissionType) {
|
51
|
+
Permission_PermissionType[Permission_PermissionType["Owner"] = 0] = "Owner";
|
52
|
+
Permission_PermissionType[Permission_PermissionType["Witness"] = 1] = "Witness";
|
53
|
+
Permission_PermissionType[Permission_PermissionType["Active"] = 2] = "Active";
|
54
|
+
Permission_PermissionType[Permission_PermissionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
55
|
+
})(Permission_PermissionType || (exports.Permission_PermissionType = Permission_PermissionType = {}));
|
56
|
+
var AccountType;
|
57
|
+
(function (AccountType) {
|
58
|
+
AccountType[AccountType["Normal"] = 0] = "Normal";
|
59
|
+
AccountType[AccountType["AssetIssue"] = 1] = "AssetIssue";
|
60
|
+
AccountType[AccountType["Contract"] = 2] = "Contract";
|
61
|
+
AccountType[AccountType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
62
|
+
})(AccountType || (exports.AccountType = AccountType = {}));
|
63
|
+
//# sourceMappingURL=Contract.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Contract.js","sourceRoot":"","sources":["../../../src/types/Contract.ts"],"names":[],"mappings":";;;AAEA,IAAY,YA2CX;AA3CD,WAAY,YAAY;IACpB,+DAA+C,CAAA;IAC/C,qDAAqC,CAAA;IACrC,+DAA+C,CAAA;IAC/C,uDAAuC,CAAA;IACvC,2DAA2C,CAAA;IAC3C,+DAA+C,CAAA;IAC/C,yDAAyC,CAAA;IACzC,+DAA+C,CAAA;IAC/C,+EAA+D,CAAA;IAC/D,+DAA+C,CAAA;IAC/C,+DAA+C,CAAA;IAC/C,mEAAmD,CAAA;IACnD,2EAA2D,CAAA;IAC3D,mEAAmD,CAAA;IACnD,+DAA+C,CAAA;IAC/C,2DAA2C,CAAA;IAC3C,iEAAiD,CAAA;IACjD,mEAAmD,CAAA;IACnD,iEAAiD,CAAA;IACjD,6DAA6C,CAAA;IAC7C,iDAAiC,CAAA;IACjC,2DAA2C,CAAA;IAC3C,6DAA6C,CAAA;IAC7C,2CAA2B,CAAA;IAC3B,+DAA+C,CAAA;IAC/C,iEAAiD,CAAA;IACjD,iEAAiD,CAAA;IACjD,qEAAqD,CAAA;IACrD,2EAA2D,CAAA;IAC3D,uEAAuD,CAAA;IACvD,mFAAmE,CAAA;IACnE,qDAAqC,CAAA;IACrC,mEAAmD,CAAA;IACnD,qEAAqD,CAAA;IACrD,mEAAmD,CAAA;IACnD,uEAAuD,CAAA;IACvD,mEAAmD,CAAA;IACnD,uEAAuD,CAAA;IACvD,iFAAiE,CAAA;IACjE,qEAAqD,CAAA;IACrD,yEAAyD,CAAA;IACzD,6CAA6B,CAAA;AACjC,CAAC,EA3CW,YAAY,4BAAZ,YAAY,QA2CvB;AACD,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACjC,2EAAS,CAAA;IACT,+EAAW,CAAA;IACX,6EAAU,CAAA;IACV,0FAAiB,CAAA;AACrB,CAAC,EALW,yBAAyB,yCAAzB,yBAAyB,QAKpC;AAOD,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,iDAAU,CAAA;IACV,yDAAc,CAAA;IACd,qDAAY,CAAA;IACZ,8DAAiB,CAAA;AACrB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { RawAxiosRequestHeaders, AxiosHeaders, HeadersDefaults } from 'axios';
|
2
|
+
export type HeadersType = RawAxiosRequestHeaders | InstanceType<typeof AxiosHeaders> | Partial<HeadersDefaults>;
|
3
|
+
export type RequestHeaders = RawAxiosRequestHeaders;
|
4
|
+
export interface HttpProviderInstance {
|
5
|
+
request<R = unknown>(config: any): Promise<{
|
6
|
+
data: R;
|
7
|
+
}>;
|
8
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Providers.js","sourceRoot":"","sources":["../../../src/types/Providers.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { ContractParamter, ContractType, CreateSmartContract, TriggerSmartContract } from './Contract.js';
|
2
|
+
export interface ContractParamterWrapper<T = ContractParamter> {
|
3
|
+
value: T;
|
4
|
+
type_url: string;
|
5
|
+
}
|
6
|
+
export interface TransactionContract<T = ContractParamter> {
|
7
|
+
type: ContractType;
|
8
|
+
parameter: ContractParamterWrapper<T>;
|
9
|
+
Permission_id?: number;
|
10
|
+
}
|
11
|
+
export interface Transaction<T = ContractParamter> {
|
12
|
+
visible: boolean;
|
13
|
+
txID: string;
|
14
|
+
raw_data: {
|
15
|
+
contract: TransactionContract<T>[];
|
16
|
+
ref_block_bytes: string;
|
17
|
+
ref_block_hash: string;
|
18
|
+
expiration: number;
|
19
|
+
timestamp: number;
|
20
|
+
data?: unknown;
|
21
|
+
fee_limit?: unknown;
|
22
|
+
};
|
23
|
+
raw_data_hex: string;
|
24
|
+
}
|
25
|
+
export interface CreateSmartContractTransaction extends Transaction<CreateSmartContract> {
|
26
|
+
/**
|
27
|
+
* Address of smart contract.
|
28
|
+
*/
|
29
|
+
contract_address: string;
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* `TransactionWrapper` interface is returned when user trigger a smart contract.
|
33
|
+
*/
|
34
|
+
export interface TransactionWrapper {
|
35
|
+
Error?: string;
|
36
|
+
result: {
|
37
|
+
result: boolean;
|
38
|
+
message?: string;
|
39
|
+
};
|
40
|
+
/**
|
41
|
+
* The transaction object created by calling contract function.
|
42
|
+
*/
|
43
|
+
transaction: Transaction<TriggerSmartContract>;
|
44
|
+
/**
|
45
|
+
* Energy required for successfully deploying new contract or trigger contract.
|
46
|
+
* This is returned in `transactionBuilder.estimateEnergy()` and `transactionBuilder.deployConstantContract()`
|
47
|
+
*/
|
48
|
+
energy_required?: number;
|
49
|
+
/**
|
50
|
+
* The penalty energy consumption.
|
51
|
+
*/
|
52
|
+
energy_penalty?: number;
|
53
|
+
/**
|
54
|
+
* Energy used by triggering contract.
|
55
|
+
*/
|
56
|
+
energy_used?: number;
|
57
|
+
/**
|
58
|
+
* Result of calling contract function which is decorated by `view` or `pure`.
|
59
|
+
*/
|
60
|
+
constant_result?: any;
|
61
|
+
}
|
62
|
+
export interface SignedTransaction<T extends ContractParamter = ContractParamter> extends Transaction<T> {
|
63
|
+
signature: string[];
|
64
|
+
contract_address?: string;
|
65
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../src/types/Transaction.ts"],"names":[],"mappings":""}
|