Skip to content

Commit 631ccea

Browse files
authored
Merge pull request #675 from tronprotocol/release_v4.7.3
merge release_4.7.3 into master
2 parents 31e626e + 230a078 commit 631ccea

File tree

7 files changed

+164
-16
lines changed

7 files changed

+164
-16
lines changed

README.md

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,42 +64,43 @@ We can configure java-tron node IP and port in ``src/main/resources/config.conf`
6464
Following is a list of Tron Wallet-cli commands:
6565
For more information on a specific command, just type the command on terminal when you start your Wallet.
6666

67-
| [AddTransactionSign](#How-to-use-the-multi-signature-feature-of-wallet-cli) | [ApproveProposal](#Approvecancel-the-proposal) | [AssetIssue](#How-to-issue-TRC10-tokens) |
67+
| [AddTransactionSign](#How-to-use-the-multi-signature-feature-of-wallet-cli) | [ApproveProposal](#Approve--disapprove-a-proposal) | [AssetIssue](#Issue-trc10-tokens) |
6868
| :---------:|:---------:|:--------: |
6969
| [BackupShieldedTRC20Wallet](#How-to-transfer-shielded-TRC20-token) | [BackupWallet](#Wallet-related-commands)| [BackupWallet2Base64](#Wallet-related-commands) |
70-
| [BroadcastTransaction](#Some-others) | [ChangePassword](#Wallet-related-commands)| [CreateProposal](#How-to-initiate-a-proposal)
71-
| [DeleteProposal](#Cancel-the-created-proposal) | [DeployContract](#How-to-use-smart-contract) | [ExchangeCreate](#How-to-trade-on-the-exchange) |
70+
| [BroadcastTransaction](#Some-others) | [ChangePassword](#Wallet-related-commands)| [CreateProposal](#Initiate-a-proposal)
71+
| [DeleteProposal](#Delete-an-existed-proposal) | [DeployContract](#How-to-use-smart-contract) | [ExchangeCreate](#How-to-trade-on-the-exchange) |
7272
| [ExchangeInject](#How-to-trade-on-the-exchange) | [ExchangeTransaction](#How-to-trade-on-the-exchange) | [ExchangeWithdraw](#How-to-trade-on-the-exchange) |
73-
| [FreezeBalance](#How-to-delegate-resourcee) | [GenerateAddress](#Account-related-commands) | [GenerateShieldedTRC20Address](#How-to-transfer-shielded-TRC20-token)|
73+
| [FreezeBalance](#Delegate-resource) | [GenerateAddress](#Account-related-commands) | [GenerateShieldedTRC20Address](#How-to-transfer-shielded-TRC20-token)|
7474
| [GetAccount](#Account-related-commands) |[GetAccountNet](#Account-related-commands) | [GetAccountResource](#Account-related-commands) |
75-
| [GetAddress](#Account-related-commands) | [GetAkFromAsk](#How-to-transfer-shielded-TRC20-token) |[GetAssetIssueByAccount](#How-to-issue-TRC10-tokens) |
76-
| [GetAssetIssueById](#How-to-issue-TRC10-tokens) | [GetAssetIssueByName](#How-to-issue-TRC10-tokens) |[GetAssetIssueListByName](#How-to-issue-TRC10-tokens) |
75+
| [GetAddress](#Account-related-commands) | [GetAkFromAsk](#How-to-transfer-shielded-TRC20-token) |[GetAssetIssueByAccount](#How-to-obtain-trc10-token-information) |
76+
| [GetAssetIssueById](#How-to-obtain-trc10-token-information) | [GetAssetIssueByName](#How-to-obtain-trc10-token-information) |[GetAssetIssueListByName](#How-to-obtain-trc10-token-information) |
7777
| [GetBalance](#Account-related-commands) | [GetBlock](#How-to-get-block-information) |[GetBlockById](#How-to-get-block-information) |
7878
| [GetBlockByLatestNum](#How-to-get-block-information) | [GetBlockByLimitNext](#How-to-get-block-information) | [GetBrokerage](#Brokerage) |
79-
| [GetContract](#How-to-use-smart-contracts) | [GetDelegatedResource](#How-to-delegate-resource) |[GetDelegatedResourceAccountIndex](#How-to-delegate-resource) |
79+
| [GetContract](#Get-details-of-a-smart-contract) | [GetDelegatedResource](#How-to-delegate-resource) |[GetDelegatedResourceAccountIndex](#How-to-delegate-resource) |
8080
| [GetDiversifier](#How-to-transfer-shielded-TRC20-token)| [GetExpandedSpendingKey](#How-to-transfer-shielded-TRC20-token)| [GetIncomingViewingKey](#How-to-transfer-shielded-TRC20-token) |
8181
| [GetMarketOrderByAccount](#How-to-use-tron-dex-to-sell-asset)| [GetMarketOrderById](#How-to-use-tron-dex-to-sell-asset)| [GetMarketOrderListByPair](#How-to-use-tron-dex-to-sell-asset) |
8282
| [GetMarketPairList](#How-to-use-tron-dex-to-sell-asset)| [GetMarketPriceByPair](#How-to-use-tron-dex-to-sell-asset)| [GetNextMaintenanceTime](#Some-others) |
83-
| [GetNkFromNsk](#How-to-transfer-shielded-TRC20-token) | [GetProposal](#Get-proposal-information) | [GetShieldedPaymentAddress](#How-to-transfer-shielded-TRC20-token)|
83+
| [GetNkFromNsk](#How-to-transfer-shielded-TRC20-token) | [GetProposal](#Obtain-proposal-information) | [GetShieldedPaymentAddress](#How-to-transfer-shielded-TRC20-token)|
8484
| [GetSpendingKey](#How-to-transfer-shielded-TRC20-token) | [GetReward](#Brokerage) | [GetTransactionApprovedList](#How-to-use-the-multi-signature-feature-of-wallet-cli) |
8585
| [GetTransactionById](#How-to-get-transaction-information) | [GetTransactionCountByBlockNum](#How-to-get-transaction-information) | [GetTransactionInfoByBlockNum](#How-to-get-transaction-information) |
8686
| [GetTransactionInfoById](#How-to-get-transaction-information) | [GetTransactionSignWeight](#How-to-use-the-multi-signature-feature-of-wallet-cli) | [ImportShieldedTRC20Wallet](#How-to-transfer-shielded-TRC20-token) |
87-
| [ImportWallet](#Wallet-related-commands) | [ImportWalletByBase64](#Wallet-related-commands) | [ListAssetIssue](#Get-Token10) |
87+
| [ImportWallet](#Wallet-related-commands) | [ImportWalletByBase64](#Wallet-related-commands) | [ListAssetIssue](#How-to-obtain-trc10-token-information) |
8888
| [ListExchanges](#How-to-trade-on-the-exchange) | [ListExchangesPaginated](#How-to-trade-on-the-exchange) | [ListNodes](#Some-others) |
89-
| [ListShieldedTRC20Address](#How-to-transfer-shielded-TRC20-token) | [ListShieldedTRC20Note](#How-to-transfer-shielded-TRC20-token) | [ListProposals](#How-to-initiate-a-proposal) |
90-
| [ListProposalsPaginated](#How-to-initiate-a-proposal) | [ListWitnesses](#Some-others) | [LoadShieldedTRC20Wallet](#How-to-transfer-shielded-TRC20-token) |
89+
| [ListShieldedTRC20Address](#How-to-transfer-shielded-TRC20-token) | [ListShieldedTRC20Note](#How-to-transfer-shielded-TRC20-token) | [ListProposals](#Obtain-proposal-information) |
90+
| [ListProposalsPaginated](#Obtain-proposal-information) | [ListWitnesses](#Some-others) | [LoadShieldedTRC20Wallet](#How-to-transfer-shielded-TRC20-token) |
9191
| [Login](#Command-line-operation-flow-example) | [MarketCancelOrder](#How-to-use-tron-dex-to-sell-asset) | [MarketSellAsset](#How-to-use-tron-dex-to-sell-asset)|
92-
| [ParticipateAssetIssue](#How-to-issue-TRC10-tokens) | [RegisterWallet](#Wallet-related-commands) | [ResetShieldedTRC20Note](#How-to-transfer-shielded-TRC20-token) |
92+
| [ParticipateAssetIssue](#Participating-in-the-issue-of-trc10-token) | [RegisterWallet](#Wallet-related-commands) | [ResetShieldedTRC20Note](#How-to-transfer-shielded-TRC20-token) |
9393
| [ScanShieldedTRC20NoteByIvk](#How-to-transfer-shielded-TRC20-token) | [ScanShieldedTRC20NoteByOvk](#How-to-transfer-shielded-TRC20-token) |[SendCoin](#How-to-use-the-multi-signature-feature-of-wallet-cli) |
9494
| [SendShieldedTRC20Coin](#How-to-transfer-shielded-TRC20-token) | [SendShieldedTRC20CoinWithoutAsk](#How-to-transfer-shielded-TRC20-token) | [SetShieldedTRC20ContractAddress](#How-to-transfer-shielded-TRC20-token) |
95-
| [ShowShieldedTRC20AddressInfo](#How-to-transfer-shielded-TRC20-token) | [TransferAsset](#How-to-issue-TRC10-tokens) | [TriggerContract](#How-to-use-smart-contracts) |
96-
| [UnfreezeAsset](#How-to-issue-TRC10-tokens) | [UnfreezeBalance](#How-to-delegate-resource) |[UpdateAsset](#How-to-issue-TRC10-tokens) |
97-
| [UpdateBrokerage](#Brokerage) | [UpdateEnergyLimit](#How-to-use-smart-contracts) |[UpdateSetting](#How-to-use-smart-contracts) |
95+
| [ShowShieldedTRC20AddressInfo](#How-to-transfer-shielded-TRC20-token) | [TransferAsset](#Trc10-token-transfer) | [TriggerContract](#Trigger-smart-contarct) |
96+
| [UnfreezeAsset](#Unfreeze-trc10-token) | [UnfreezeBalance](#How-to-delegate-resource) |[UpdateAsset](#Update-parameters-of-trc10-token) |
97+
| [UpdateBrokerage](#Brokerage) | [UpdateEnergyLimit](#Update-smart-contract-parameters) |[UpdateSetting](#Update-smart-contract-parameters) |
9898
| [UpdateAccountPermission](#How-to-use-the-multi-signature-feature-of-wallet-cli) | [VoteWitness](#How-to-vote) | [FreezeBalanceV2](#How-to-freezev2) |
9999
| [UnfreezeBalanceV2](#How-to-freezev2) | [DelegateResource](#How-to-freezev2) | [UnDelegateResource](#How-to-freezev2) |
100100
| [WithdrawExpireUnfreeze](#How-to-freezev2) | [CancelAllUnfreezeV2](#How-to-freezev2) |[GetDelegatedResourceV2](#How-to-freezev2) |
101101
| [GetDelegatedResourceAccountIndexV2](#How-to-freezev2) | [GetCanDelegatedMaxSize](#How-to-freezev2) | [GetAvailableUnfreezeCount](#How-to-freezev2) |
102-
| [GetCanWithdrawUnfreezeAmount](#How-to-freezev2) | | |
102+
| [GetCanWithdrawUnfreezeAmount](#How-to-freezev2) |[GetBandwidthPrices](#Get-resource-prices-and-memo-fee) | [GetEnergyPrices](#Get-resource-prices-and-memo-fee)|
103+
| [GetMemoFee](#Get-resource-prices-and-memo-fee) |||
103104

104105
Type any one of the listed commands, to display how-to tips.
105106

@@ -1474,6 +1475,37 @@ wallet> getCanWithdrawUnfreezeAmount TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 16711003
14741475
"amount": 9000000
14751476
}
14761477
```
1478+
## Get resource prices and memo fee
1479+
> getbandwidthprices
1480+
> get historical unit price of bandwidth
1481+
1482+
Example:
1483+
```console
1484+
wallet> getBandwidthPrices
1485+
{
1486+
"prices": "0:10,1606537680000:40,1614238080000:140,1626581880000:1000,1626925680000:140,1627731480000:1000"
1487+
}
1488+
```
1489+
> getenergyprices
1490+
> get historical unit price of energy
1491+
1492+
Example:
1493+
```console
1494+
wallet> getEnergyPrices
1495+
{
1496+
"prices": "0:100,1575871200000:10,1606537680000:40,1614238080000:140,1635739080000:280,1681895880000:420"
1497+
}
1498+
```
1499+
> getmemofee
1500+
> get memo fee
1501+
1502+
Example:
1503+
```console
1504+
wallet> getMemoFee
1505+
{
1506+
"prices": "0:0,1675492680000:1000000"
1507+
}
1508+
```
14771509

14781510

14791511
## Wallet related commands

src/main/java/org/tron/walletcli/Client.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public class Client {
115115
"GetAssetIssueByName",
116116
"GetAssetIssueListByName",
117117
"GetBalance",
118+
"GetBandwidthPrices",
118119
"GetBlock",
119120
"GetBlockById",
120121
"GetBlockByIdOrNum",
@@ -132,6 +133,7 @@ public class Client {
132133
"GetAvailableUnfreezeCount",
133134
"GetCanWithdrawUnfreezeAmount",
134135
"GetDiversifier",
136+
"GetEnergyPrices",
135137
"GetExchange",
136138
"GetExpandedSpendingKey",
137139
"GetIncomingViewingKey",
@@ -140,6 +142,7 @@ public class Client {
140142
"GetMarketOrderListByPair",
141143
"GetMarketPairList",
142144
"GetMarketPriceByPair",
145+
"GetMemoFee",
143146
"GetNextMaintenanceTime",
144147
"GetNkFromNsk",
145148
"GetProposal",
@@ -258,6 +261,7 @@ public class Client {
258261
"GetAssetIssueByName",
259262
"GetAssetIssueListByName",
260263
"GetBalance",
264+
"GetBandwidthPrices",
261265
"GetBlock",
262266
"GetBlockById",
263267
"GetBlockByIdOrNum",
@@ -275,6 +279,7 @@ public class Client {
275279
"GetAvailableUnfreezeCount",
276280
"GetCanWithdrawUnfreezeAmount",
277281
"GetDiversifier",
282+
"GetEnergyPrices",
278283
"GetExchange",
279284
"GetExpandedSpendingKey",
280285
"GetIncomingViewingKey",
@@ -283,6 +288,7 @@ public class Client {
283288
"GetMarketOrderListByPair",
284289
"GetMarketPairList",
285290
"GetMarketPriceByPair",
291+
"GetMemoFee",
286292
"GetNextMaintenanceTime",
287293
"GetNkFromNsk",
288294
"GetProposal",
@@ -1533,6 +1539,36 @@ private void cancelAllUnfreezeV2(String[] parameters)
15331539
}
15341540
}
15351541

1542+
private void getBandwidthPrices(String[] parameters) {
1543+
if (parameters.length > 0) {
1544+
System.out.println("Use GetBandwidthPrices command with below syntax: ");
1545+
System.out.println("GetBandwidthPrices");
1546+
return;
1547+
}
1548+
PricesResponseMessage result = walletApiWrapper.getBandwidthPrices();
1549+
System.out.println("The BandwidthPrices is " + result.getPrices());
1550+
}
1551+
1552+
private void getEnergyPrices(String[] parameters) {
1553+
if (parameters.length > 0) {
1554+
System.out.println("Use GetEnergyPrices command with below syntax: ");
1555+
System.out.println("GetEnergyPrices");
1556+
return;
1557+
}
1558+
PricesResponseMessage result = walletApiWrapper.getEnergyPrices();
1559+
System.out.println("The EnergyPrices is "+ result.getPrices());
1560+
}
1561+
1562+
private void getMemoFee(String[] parameters) {
1563+
if (parameters.length > 0) {
1564+
System.out.println("Use GetMemoFee command with below syntax: ");
1565+
System.out.println("GetMemoFee");
1566+
return;
1567+
}
1568+
PricesResponseMessage result = walletApiWrapper.getMemoFee();
1569+
System.out.println("The MemoFee is " + result.getPrices());
1570+
}
1571+
15361572
private void unfreezeAsset(String[] parameters) throws IOException,
15371573
CipherException, CancelException {
15381574
System.out.println("Use UnfreezeAsset command like: ");
@@ -4938,6 +4974,18 @@ private void run() {
49384974
getBlockByIdOrNum(parameters);
49394975
break;
49404976
}
4977+
case "getbandwidthprices": {
4978+
getBandwidthPrices(parameters);
4979+
break;
4980+
}
4981+
case "getenergyprices": {
4982+
getEnergyPrices(parameters);
4983+
break;
4984+
}
4985+
case "getmemofee": {
4986+
getMemoFee(parameters);
4987+
break;
4988+
}
49414989
case "exit":
49424990
case "quit": {
49434991
System.out.println("Exit !!!");

src/main/java/org/tron/walletcli/WalletApiWrapper.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,18 @@ public GrpcAPI.NumberMessage getBrokerage(byte[] ownerAddress) {
12931293
return WalletApi.getBrokerage(ownerAddress);
12941294
}
12951295

1296+
public PricesResponseMessage getBandwidthPrices() {
1297+
return WalletApi.getBandwidthPrices();
1298+
}
1299+
1300+
public PricesResponseMessage getEnergyPrices() {
1301+
return WalletApi.getEnergyPrices();
1302+
}
1303+
1304+
public PricesResponseMessage getMemoFee() {
1305+
return WalletApi.getMemoFee();
1306+
}
1307+
12961308
public boolean scanShieldedTRC20NoteByIvk(byte[] address, final String ivk,
12971309
final String ak, final String nk,
12981310
long start, long end, String[] events) {

src/main/java/org/tron/walletserver/GrpcClient.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,29 @@ public NumberMessage getBrokerage(byte[] address) {
10011001
}
10021002
}
10031003

1004+
public PricesResponseMessage getBandwidthPrices() {
1005+
EmptyMessage message = EmptyMessage.newBuilder().build();
1006+
if (blockingStubSolidity != null) {
1007+
return blockingStubSolidity.getBandwidthPrices(message);
1008+
} else {
1009+
return blockingStubFull.getBandwidthPrices(message);
1010+
}
1011+
}
1012+
1013+
public PricesResponseMessage getEnergyPrices() {
1014+
EmptyMessage message = EmptyMessage.newBuilder().build();
1015+
if (blockingStubSolidity != null) {
1016+
return blockingStubSolidity.getEnergyPrices(message);
1017+
} else {
1018+
return blockingStubFull.getEnergyPrices(message);
1019+
}
1020+
}
1021+
1022+
public PricesResponseMessage getMemoFee() {
1023+
EmptyMessage message = EmptyMessage.newBuilder().build();
1024+
return blockingStubFull.getMemoFee(message);
1025+
}
1026+
10041027
public Optional<TransactionInfoList> getTransactionInfoByBlockNum(long blockNum) {
10051028
TransactionInfoList transactionInfoList;
10061029
NumberMessage.Builder builder = NumberMessage.newBuilder();

src/main/java/org/tron/walletserver/WalletApi.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import org.tron.api.GrpcAPI.OvkDecryptParameters;
5858
import org.tron.api.GrpcAPI.OvkDecryptTRC20Parameters;
5959
import org.tron.api.GrpcAPI.PaymentAddressMessage;
60+
import org.tron.api.GrpcAPI.PricesResponseMessage;
6061
import org.tron.api.GrpcAPI.PrivateParameters;
6162
import org.tron.api.GrpcAPI.PrivateParametersWithoutAsk;
6263
import org.tron.api.GrpcAPI.PrivateShieldedTRC20Parameters;
@@ -2730,6 +2731,18 @@ public static GrpcAPI.NumberMessage getBrokerage(byte[] owner) {
27302731
return rpcCli.getBrokerage(owner);
27312732
}
27322733

2734+
public static PricesResponseMessage getBandwidthPrices() {
2735+
return rpcCli.getBandwidthPrices();
2736+
}
2737+
2738+
public static PricesResponseMessage getEnergyPrices() {
2739+
return rpcCli.getEnergyPrices();
2740+
}
2741+
2742+
public static PricesResponseMessage getMemoFee() {
2743+
return rpcCli.getMemoFee();
2744+
}
2745+
27332746
public static Optional<DecryptNotesTRC20> scanShieldedTRC20NoteByIvk(
27342747
IvkDecryptTRC20Parameters parameters, boolean showErrorMsg) {
27352748
try {

src/main/protos/api/api.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,15 @@ service Wallet {
767767

768768
rpc GetBlock (BlockReq) returns (BlockExtention) {
769769
}
770+
771+
rpc GetBandwidthPrices (EmptyMessage) returns (PricesResponseMessage) {
772+
}
773+
774+
rpc GetEnergyPrices (EmptyMessage) returns (PricesResponseMessage) {
775+
}
776+
777+
rpc GetMemoFee (EmptyMessage) returns (PricesResponseMessage) {
778+
}
770779
};
771780

772781
service WalletSolidity {
@@ -963,6 +972,11 @@ service WalletSolidity {
963972
}
964973
rpc GetBlock (BlockReq) returns (BlockExtention) {
965974
}
975+
rpc GetBandwidthPrices (EmptyMessage) returns (PricesResponseMessage) {
976+
}
977+
978+
rpc GetEnergyPrices (EmptyMessage) returns (PricesResponseMessage) {
979+
}
966980
};
967981

968982
service WalletExtension {
@@ -1109,6 +1123,10 @@ message CanWithdrawUnfreezeAmountResponseMessage {
11091123
int64 amount = 1;
11101124
}
11111125

1126+
message PricesResponseMessage {
1127+
string prices = 1;
1128+
}
1129+
11121130
// Gossip node list
11131131
message NodeList {
11141132
repeated Node nodes = 1;

src/main/protos/core/Tron.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ enum ReasonCode {
601601
TOO_MANY_PEERS_WITH_SAME_IP = 0x22;
602602
LIGHT_NODE_SYNC_FAIL = 0x23;
603603
BELOW_THAN_ME = 0X24;
604+
NOT_WITNESS = 0x25;
605+
NO_SUCH_MESSAGE = 0x26;
604606
UNKNOWN = 0xFF;
605607
}
606608

0 commit comments

Comments
 (0)