From 01fd1701082dc1da4409d6572cbcfd34edf572df Mon Sep 17 00:00:00 2001 From: Mostafa Date: Sat, 18 Jan 2025 22:32:45 +0800 Subject: [PATCH] feat: update the proto files --- examples/example_get_consensus_info.py | 21 + pactus/rpc/blockchain_pb2.py | 136 ++-- pactus/rpc/blockchain_pb2.pyi | 177 +----- pactus/rpc/blockchain_pb2_grpc.py | 671 ++++++++------------ pactus/rpc/network_pb2.py | 72 +-- pactus/rpc/network_pb2.pyi | 208 ++----- pactus/rpc/network_pb2_grpc.py | 137 ++-- pactus/rpc/ruff.toml | 3 + pactus/rpc/transaction_pb2.py | 96 ++- pactus/rpc/transaction_pb2.pyi | 167 +---- pactus/rpc/transaction_pb2_grpc.py | 427 ++++++------- pactus/rpc/utils_pb2.py | 44 +- pactus/rpc/utils_pb2.pyi | 40 +- pactus/rpc/utils_pb2_grpc.py | 196 +++--- pactus/rpc/wallet_pb2.py | 134 ++-- pactus/rpc/wallet_pb2.pyi | 185 +++--- pactus/rpc/wallet_pb2_grpc.py | 826 ++++++++++++++----------- pactus/types/amount.py | 1 + 18 files changed, 1612 insertions(+), 1929 deletions(-) create mode 100644 examples/example_get_consensus_info.py diff --git a/examples/example_get_consensus_info.py b/examples/example_get_consensus_info.py new file mode 100644 index 0000000..2b40a86 --- /dev/null +++ b/examples/example_get_consensus_info.py @@ -0,0 +1,21 @@ +from pactus.rpc.blockchain_pb2_grpc import BlockchainStub +from pactus.rpc.blockchain_pb2 import GetConsensusInfoRequest +import grpc + + +def main() -> None: + # Creating a gRPC channel + channel = grpc.insecure_channel("bootstrap1.pactus.org:50051") + + # Creating a stub from channel + stub = BlockchainStub(channel) + + # Initialize a request and call get consensus info method + req = GetConsensusInfoRequest() + consensus_info = stub.GetConsensusInfo(req) + + print(f"Consensus info:\n{consensus_info}") + + +if __name__ == "__main__": + main() diff --git a/pactus/rpc/blockchain_pb2.py b/pactus/rpc/blockchain_pb2.py index 5f26fb7..5ca6305 100644 --- a/pactus/rpc/blockchain_pb2.py +++ b/pactus/rpc/blockchain_pb2.py @@ -2,7 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: blockchain.proto """Generated protocol buffer code.""" - from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -15,75 +14,74 @@ from . import transaction_pb2 as transaction__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x10\x62lockchain.proto\x12\x06pactus\x1a\x11transaction.proto"-\n\x11GetAccountRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress"C\n\x12GetAccountResponse\x12-\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\x13.pactus.AccountInfoR\x07\x61\x63\x63ount"\x1e\n\x1cGetValidatorAddressesRequest"=\n\x1dGetValidatorAddressesResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses"/\n\x13GetValidatorRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress"5\n\x1bGetValidatorByNumberRequest\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number"K\n\x14GetValidatorResponse\x12\x33\n\tvalidator\x18\x01 \x01(\x0b\x32\x15.pactus.ValidatorInfoR\tvalidator"/\n\x13GetPublicKeyRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress"5\n\x14GetPublicKeyResponse\x12\x1d\n\npublic_key\x18\x01 \x01(\tR\tpublicKey"_\n\x0fGetBlockRequest\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x34\n\tverbosity\x18\x02 \x01(\x0e\x32\x16.pactus.BlockVerbosityR\tverbosity"\x83\x02\n\x10GetBlockResponse\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x12\n\x04hash\x18\x02 \x01(\tR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x03 \x01(\tR\x04\x64\x61ta\x12\x1d\n\nblock_time\x18\x04 \x01(\rR\tblockTime\x12/\n\x06header\x18\x05 \x01(\x0b\x32\x17.pactus.BlockHeaderInfoR\x06header\x12\x34\n\tprev_cert\x18\x06 \x01(\x0b\x32\x17.pactus.CertificateInfoR\x08prevCert\x12)\n\x03txs\x18\x07 \x03(\x0b\x32\x17.pactus.TransactionInfoR\x03txs"-\n\x13GetBlockHashRequest\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height"*\n\x14GetBlockHashResponse\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash"+\n\x15GetBlockHeightRequest\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash"0\n\x16GetBlockHeightResponse\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height"\x1a\n\x18GetBlockchainInfoRequest"\xc1\x03\n\x19GetBlockchainInfoResponse\x12*\n\x11last_block_height\x18\x01 \x01(\rR\x0flastBlockHeight\x12&\n\x0flast_block_hash\x18\x02 \x01(\tR\rlastBlockHash\x12%\n\x0etotal_accounts\x18\x03 \x01(\x05R\rtotalAccounts\x12)\n\x10total_validators\x18\x04 \x01(\x05R\x0ftotalValidators\x12\x1f\n\x0btotal_power\x18\x05 \x01(\x03R\ntotalPower\x12\'\n\x0f\x63ommittee_power\x18\x06 \x01(\x03R\x0e\x63ommitteePower\x12H\n\x14\x63ommittee_validators\x18\x07 \x03(\x0b\x32\x15.pactus.ValidatorInfoR\x13\x63ommitteeValidators\x12\x1b\n\tis_pruned\x18\x08 \x01(\x08R\x08isPruned\x12%\n\x0epruning_height\x18\t \x01(\rR\rpruningHeight\x12&\n\x0flast_block_time\x18\n \x01(\x03R\rlastBlockTime"\x19\n\x17GetConsensusInfoRequest"O\n\x18GetConsensusInfoResponse\x12\x33\n\tinstances\x18\x01 \x03(\x0b\x32\x15.pactus.ConsensusInfoR\tinstances"Q\n\x17GetTxPoolContentRequest\x12\x36\n\x0cpayload_type\x18\x01 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bpayloadType"E\n\x18GetTxPoolContentResponse\x12)\n\x03txs\x18\x01 \x03(\x0b\x32\x17.pactus.TransactionInfoR\x03txs"\xdc\x02\n\rValidatorInfo\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\tR\x04\x64\x61ta\x12\x1d\n\npublic_key\x18\x03 \x01(\tR\tpublicKey\x12\x16\n\x06number\x18\x04 \x01(\x05R\x06number\x12\x14\n\x05stake\x18\x05 \x01(\x03R\x05stake\x12.\n\x13last_bonding_height\x18\x06 \x01(\rR\x11lastBondingHeight\x12\x32\n\x15last_sortition_height\x18\x07 \x01(\rR\x13lastSortitionHeight\x12)\n\x10unbonding_height\x18\x08 \x01(\rR\x0funbondingHeight\x12\x18\n\x07\x61\x64\x64ress\x18\t \x01(\tR\x07\x61\x64\x64ress\x12-\n\x12\x61vailability_score\x18\n \x01(\x01R\x11\x61vailabilityScore"\x81\x01\n\x0b\x41\x63\x63ountInfo\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\tR\x04\x64\x61ta\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x18\n\x07\x62\x61lance\x18\x04 \x01(\x03R\x07\x62\x61lance\x12\x18\n\x07\x61\x64\x64ress\x18\x05 \x01(\tR\x07\x61\x64\x64ress"\xc4\x01\n\x0f\x42lockHeaderInfo\x12\x18\n\x07version\x18\x01 \x01(\x05R\x07version\x12&\n\x0fprev_block_hash\x18\x02 \x01(\tR\rprevBlockHash\x12\x1d\n\nstate_root\x18\x03 \x01(\tR\tstateRoot\x12%\n\x0esortition_seed\x18\x04 \x01(\tR\rsortitionSeed\x12)\n\x10proposer_address\x18\x05 \x01(\tR\x0fproposerAddress"\x97\x01\n\x0f\x43\x65rtificateInfo\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\x12\x14\n\x05round\x18\x02 \x01(\x05R\x05round\x12\x1e\n\ncommitters\x18\x03 \x03(\x05R\ncommitters\x12\x1c\n\tabsentees\x18\x04 \x03(\x05R\tabsentees\x12\x1c\n\tsignature\x18\x05 \x01(\tR\tsignature"\xb1\x01\n\x08VoteInfo\x12$\n\x04type\x18\x01 \x01(\x0e\x32\x10.pactus.VoteTypeR\x04type\x12\x14\n\x05voter\x18\x02 \x01(\tR\x05voter\x12\x1d\n\nblock_hash\x18\x03 \x01(\tR\tblockHash\x12\x14\n\x05round\x18\x04 \x01(\x05R\x05round\x12\x19\n\x08\x63p_round\x18\x05 \x01(\x05R\x07\x63pRound\x12\x19\n\x08\x63p_value\x18\x06 \x01(\x05R\x07\x63pValue"\x97\x01\n\rConsensusInfo\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x16\n\x06\x61\x63tive\x18\x02 \x01(\x08R\x06\x61\x63tive\x12\x16\n\x06height\x18\x03 \x01(\rR\x06height\x12\x14\n\x05round\x18\x04 \x01(\x05R\x05round\x12&\n\x05votes\x18\x05 \x03(\x0b\x32\x10.pactus.VoteInfoR\x05votes*H\n\x0e\x42lockVerbosity\x12\x0e\n\nBLOCK_DATA\x10\x00\x12\x0e\n\nBLOCK_INFO\x10\x01\x12\x16\n\x12\x42LOCK_TRANSACTIONS\x10\x02*\\\n\x08VoteType\x12\x10\n\x0cVOTE_UNKNOWN\x10\x00\x12\x10\n\x0cVOTE_PREPARE\x10\x01\x12\x12\n\x0eVOTE_PRECOMMIT\x10\x02\x12\x18\n\x14VOTE_CHANGE_PROPOSER\x10\x03\x32\x8b\x07\n\nBlockchain\x12=\n\x08GetBlock\x12\x17.pactus.GetBlockRequest\x1a\x18.pactus.GetBlockResponse\x12I\n\x0cGetBlockHash\x12\x1b.pactus.GetBlockHashRequest\x1a\x1c.pactus.GetBlockHashResponse\x12O\n\x0eGetBlockHeight\x12\x1d.pactus.GetBlockHeightRequest\x1a\x1e.pactus.GetBlockHeightResponse\x12X\n\x11GetBlockchainInfo\x12 .pactus.GetBlockchainInfoRequest\x1a!.pactus.GetBlockchainInfoResponse\x12U\n\x10GetConsensusInfo\x12\x1f.pactus.GetConsensusInfoRequest\x1a .pactus.GetConsensusInfoResponse\x12\x43\n\nGetAccount\x12\x19.pactus.GetAccountRequest\x1a\x1a.pactus.GetAccountResponse\x12I\n\x0cGetValidator\x12\x1b.pactus.GetValidatorRequest\x1a\x1c.pactus.GetValidatorResponse\x12Y\n\x14GetValidatorByNumber\x12#.pactus.GetValidatorByNumberRequest\x1a\x1c.pactus.GetValidatorResponse\x12\x64\n\x15GetValidatorAddresses\x12$.pactus.GetValidatorAddressesRequest\x1a%.pactus.GetValidatorAddressesResponse\x12I\n\x0cGetPublicKey\x12\x1b.pactus.GetPublicKeyRequest\x1a\x1c.pactus.GetPublicKeyResponse\x12U\n\x10GetTxPoolContent\x12\x1f.pactus.GetTxPoolContentRequest\x1a .pactus.GetTxPoolContentResponseBE\n\x11pactus.blockchainZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3' -) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x62lockchain.proto\x12\x06pactus\x1a\x11transaction.proto\"-\n\x11GetAccountRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"C\n\x12GetAccountResponse\x12-\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\x13.pactus.AccountInfoR\x07\x61\x63\x63ount\"\x1e\n\x1cGetValidatorAddressesRequest\"=\n\x1dGetValidatorAddressesResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"/\n\x13GetValidatorRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"5\n\x1bGetValidatorByNumberRequest\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\"K\n\x14GetValidatorResponse\x12\x33\n\tvalidator\x18\x01 \x01(\x0b\x32\x15.pactus.ValidatorInfoR\tvalidator\"/\n\x13GetPublicKeyRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"5\n\x14GetPublicKeyResponse\x12\x1d\n\npublic_key\x18\x01 \x01(\tR\tpublicKey\"_\n\x0fGetBlockRequest\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x34\n\tverbosity\x18\x02 \x01(\x0e\x32\x16.pactus.BlockVerbosityR\tverbosity\"\x83\x02\n\x10GetBlockResponse\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x12\n\x04hash\x18\x02 \x01(\tR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x03 \x01(\tR\x04\x64\x61ta\x12\x1d\n\nblock_time\x18\x04 \x01(\rR\tblockTime\x12/\n\x06header\x18\x05 \x01(\x0b\x32\x17.pactus.BlockHeaderInfoR\x06header\x12\x34\n\tprev_cert\x18\x06 \x01(\x0b\x32\x17.pactus.CertificateInfoR\x08prevCert\x12)\n\x03txs\x18\x07 \x03(\x0b\x32\x17.pactus.TransactionInfoR\x03txs\"-\n\x13GetBlockHashRequest\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\"*\n\x14GetBlockHashResponse\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\"+\n\x15GetBlockHeightRequest\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\"0\n\x16GetBlockHeightResponse\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\"\x1a\n\x18GetBlockchainInfoRequest\"\xc1\x03\n\x19GetBlockchainInfoResponse\x12*\n\x11last_block_height\x18\x01 \x01(\rR\x0flastBlockHeight\x12&\n\x0flast_block_hash\x18\x02 \x01(\tR\rlastBlockHash\x12%\n\x0etotal_accounts\x18\x03 \x01(\x05R\rtotalAccounts\x12)\n\x10total_validators\x18\x04 \x01(\x05R\x0ftotalValidators\x12\x1f\n\x0btotal_power\x18\x05 \x01(\x03R\ntotalPower\x12\'\n\x0f\x63ommittee_power\x18\x06 \x01(\x03R\x0e\x63ommitteePower\x12H\n\x14\x63ommittee_validators\x18\x07 \x03(\x0b\x32\x15.pactus.ValidatorInfoR\x13\x63ommitteeValidators\x12\x1b\n\tis_pruned\x18\x08 \x01(\x08R\x08isPruned\x12%\n\x0epruning_height\x18\t \x01(\rR\rpruningHeight\x12&\n\x0flast_block_time\x18\n \x01(\x03R\rlastBlockTime\"\x19\n\x17GetConsensusInfoRequest\"\x81\x01\n\x18GetConsensusInfoResponse\x12\x30\n\x08proposal\x18\x01 \x01(\x0b\x32\x14.pactus.ProposalInfoR\x08proposal\x12\x33\n\tinstances\x18\x02 \x03(\x0b\x32\x15.pactus.ConsensusInfoR\tinstances\"Q\n\x17GetTxPoolContentRequest\x12\x36\n\x0cpayload_type\x18\x01 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bpayloadType\"E\n\x18GetTxPoolContentResponse\x12)\n\x03txs\x18\x01 \x03(\x0b\x32\x17.pactus.TransactionInfoR\x03txs\"\xdc\x02\n\rValidatorInfo\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\tR\x04\x64\x61ta\x12\x1d\n\npublic_key\x18\x03 \x01(\tR\tpublicKey\x12\x16\n\x06number\x18\x04 \x01(\x05R\x06number\x12\x14\n\x05stake\x18\x05 \x01(\x03R\x05stake\x12.\n\x13last_bonding_height\x18\x06 \x01(\rR\x11lastBondingHeight\x12\x32\n\x15last_sortition_height\x18\x07 \x01(\rR\x13lastSortitionHeight\x12)\n\x10unbonding_height\x18\x08 \x01(\rR\x0funbondingHeight\x12\x18\n\x07\x61\x64\x64ress\x18\t \x01(\tR\x07\x61\x64\x64ress\x12-\n\x12\x61vailability_score\x18\n \x01(\x01R\x11\x61vailabilityScore\"\x81\x01\n\x0b\x41\x63\x63ountInfo\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\tR\x04\x64\x61ta\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x18\n\x07\x62\x61lance\x18\x04 \x01(\x03R\x07\x62\x61lance\x12\x18\n\x07\x61\x64\x64ress\x18\x05 \x01(\tR\x07\x61\x64\x64ress\"\xc4\x01\n\x0f\x42lockHeaderInfo\x12\x18\n\x07version\x18\x01 \x01(\x05R\x07version\x12&\n\x0fprev_block_hash\x18\x02 \x01(\tR\rprevBlockHash\x12\x1d\n\nstate_root\x18\x03 \x01(\tR\tstateRoot\x12%\n\x0esortition_seed\x18\x04 \x01(\tR\rsortitionSeed\x12)\n\x10proposer_address\x18\x05 \x01(\tR\x0fproposerAddress\"\x97\x01\n\x0f\x43\x65rtificateInfo\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\x12\x14\n\x05round\x18\x02 \x01(\x05R\x05round\x12\x1e\n\ncommitters\x18\x03 \x03(\x05R\ncommitters\x12\x1c\n\tabsentees\x18\x04 \x03(\x05R\tabsentees\x12\x1c\n\tsignature\x18\x05 \x01(\tR\tsignature\"\xb1\x01\n\x08VoteInfo\x12$\n\x04type\x18\x01 \x01(\x0e\x32\x10.pactus.VoteTypeR\x04type\x12\x14\n\x05voter\x18\x02 \x01(\tR\x05voter\x12\x1d\n\nblock_hash\x18\x03 \x01(\tR\tblockHash\x12\x14\n\x05round\x18\x04 \x01(\x05R\x05round\x12\x19\n\x08\x63p_round\x18\x05 \x01(\x05R\x07\x63pRound\x12\x19\n\x08\x63p_value\x18\x06 \x01(\x05R\x07\x63pValue\"\x97\x01\n\rConsensusInfo\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x16\n\x06\x61\x63tive\x18\x02 \x01(\x08R\x06\x61\x63tive\x12\x16\n\x06height\x18\x03 \x01(\rR\x06height\x12\x14\n\x05round\x18\x04 \x01(\x05R\x05round\x12&\n\x05votes\x18\x05 \x03(\x0b\x32\x10.pactus.VoteInfoR\x05votes\"y\n\x0cProposalInfo\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x14\n\x05round\x18\x02 \x01(\x05R\x05round\x12\x1d\n\nblock_data\x18\x03 \x01(\tR\tblockData\x12\x1c\n\tsignature\x18\x04 \x01(\tR\tsignature*H\n\x0e\x42lockVerbosity\x12\x0e\n\nBLOCK_DATA\x10\x00\x12\x0e\n\nBLOCK_INFO\x10\x01\x12\x16\n\x12\x42LOCK_TRANSACTIONS\x10\x02*\\\n\x08VoteType\x12\x10\n\x0cVOTE_UNKNOWN\x10\x00\x12\x10\n\x0cVOTE_PREPARE\x10\x01\x12\x12\n\x0eVOTE_PRECOMMIT\x10\x02\x12\x18\n\x14VOTE_CHANGE_PROPOSER\x10\x03\x32\x8b\x07\n\nBlockchain\x12=\n\x08GetBlock\x12\x17.pactus.GetBlockRequest\x1a\x18.pactus.GetBlockResponse\x12I\n\x0cGetBlockHash\x12\x1b.pactus.GetBlockHashRequest\x1a\x1c.pactus.GetBlockHashResponse\x12O\n\x0eGetBlockHeight\x12\x1d.pactus.GetBlockHeightRequest\x1a\x1e.pactus.GetBlockHeightResponse\x12X\n\x11GetBlockchainInfo\x12 .pactus.GetBlockchainInfoRequest\x1a!.pactus.GetBlockchainInfoResponse\x12U\n\x10GetConsensusInfo\x12\x1f.pactus.GetConsensusInfoRequest\x1a .pactus.GetConsensusInfoResponse\x12\x43\n\nGetAccount\x12\x19.pactus.GetAccountRequest\x1a\x1a.pactus.GetAccountResponse\x12I\n\x0cGetValidator\x12\x1b.pactus.GetValidatorRequest\x1a\x1c.pactus.GetValidatorResponse\x12Y\n\x14GetValidatorByNumber\x12#.pactus.GetValidatorByNumberRequest\x1a\x1c.pactus.GetValidatorResponse\x12\x64\n\x15GetValidatorAddresses\x12$.pactus.GetValidatorAddressesRequest\x1a%.pactus.GetValidatorAddressesResponse\x12I\n\x0cGetPublicKey\x12\x1b.pactus.GetPublicKeyRequest\x1a\x1c.pactus.GetPublicKeyResponse\x12U\n\x10GetTxPoolContent\x12\x1f.pactus.GetTxPoolContentRequest\x1a .pactus.GetTxPoolContentResponseBE\n\x11pactus.blockchainZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "blockchain_pb2", globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'blockchain_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = ( - b"\n\021pactus.blockchainZ0github.com/pactus-project/pactus/www/grpc/pactus" - ) - _BLOCKVERBOSITY._serialized_start = 3000 - _BLOCKVERBOSITY._serialized_end = 3072 - _VOTETYPE._serialized_start = 3074 - _VOTETYPE._serialized_end = 3166 - _GETACCOUNTREQUEST._serialized_start = 47 - _GETACCOUNTREQUEST._serialized_end = 92 - _GETACCOUNTRESPONSE._serialized_start = 94 - _GETACCOUNTRESPONSE._serialized_end = 161 - _GETVALIDATORADDRESSESREQUEST._serialized_start = 163 - _GETVALIDATORADDRESSESREQUEST._serialized_end = 193 - _GETVALIDATORADDRESSESRESPONSE._serialized_start = 195 - _GETVALIDATORADDRESSESRESPONSE._serialized_end = 256 - _GETVALIDATORREQUEST._serialized_start = 258 - _GETVALIDATORREQUEST._serialized_end = 305 - _GETVALIDATORBYNUMBERREQUEST._serialized_start = 307 - _GETVALIDATORBYNUMBERREQUEST._serialized_end = 360 - _GETVALIDATORRESPONSE._serialized_start = 362 - _GETVALIDATORRESPONSE._serialized_end = 437 - _GETPUBLICKEYREQUEST._serialized_start = 439 - _GETPUBLICKEYREQUEST._serialized_end = 486 - _GETPUBLICKEYRESPONSE._serialized_start = 488 - _GETPUBLICKEYRESPONSE._serialized_end = 541 - _GETBLOCKREQUEST._serialized_start = 543 - _GETBLOCKREQUEST._serialized_end = 638 - _GETBLOCKRESPONSE._serialized_start = 641 - _GETBLOCKRESPONSE._serialized_end = 900 - _GETBLOCKHASHREQUEST._serialized_start = 902 - _GETBLOCKHASHREQUEST._serialized_end = 947 - _GETBLOCKHASHRESPONSE._serialized_start = 949 - _GETBLOCKHASHRESPONSE._serialized_end = 991 - _GETBLOCKHEIGHTREQUEST._serialized_start = 993 - _GETBLOCKHEIGHTREQUEST._serialized_end = 1036 - _GETBLOCKHEIGHTRESPONSE._serialized_start = 1038 - _GETBLOCKHEIGHTRESPONSE._serialized_end = 1086 - _GETBLOCKCHAININFOREQUEST._serialized_start = 1088 - _GETBLOCKCHAININFOREQUEST._serialized_end = 1114 - _GETBLOCKCHAININFORESPONSE._serialized_start = 1117 - _GETBLOCKCHAININFORESPONSE._serialized_end = 1566 - _GETCONSENSUSINFOREQUEST._serialized_start = 1568 - _GETCONSENSUSINFOREQUEST._serialized_end = 1593 - _GETCONSENSUSINFORESPONSE._serialized_start = 1595 - _GETCONSENSUSINFORESPONSE._serialized_end = 1674 - _GETTXPOOLCONTENTREQUEST._serialized_start = 1676 - _GETTXPOOLCONTENTREQUEST._serialized_end = 1757 - _GETTXPOOLCONTENTRESPONSE._serialized_start = 1759 - _GETTXPOOLCONTENTRESPONSE._serialized_end = 1828 - _VALIDATORINFO._serialized_start = 1831 - _VALIDATORINFO._serialized_end = 2179 - _ACCOUNTINFO._serialized_start = 2182 - _ACCOUNTINFO._serialized_end = 2311 - _BLOCKHEADERINFO._serialized_start = 2314 - _BLOCKHEADERINFO._serialized_end = 2510 - _CERTIFICATEINFO._serialized_start = 2513 - _CERTIFICATEINFO._serialized_end = 2664 - _VOTEINFO._serialized_start = 2667 - _VOTEINFO._serialized_end = 2844 - _CONSENSUSINFO._serialized_start = 2847 - _CONSENSUSINFO._serialized_end = 2998 - _BLOCKCHAIN._serialized_start = 3169 - _BLOCKCHAIN._serialized_end = 4076 + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\021pactus.blockchainZ0github.com/pactus-project/pactus/www/grpc/pactus' + _BLOCKVERBOSITY._serialized_start=3174 + _BLOCKVERBOSITY._serialized_end=3246 + _VOTETYPE._serialized_start=3248 + _VOTETYPE._serialized_end=3340 + _GETACCOUNTREQUEST._serialized_start=47 + _GETACCOUNTREQUEST._serialized_end=92 + _GETACCOUNTRESPONSE._serialized_start=94 + _GETACCOUNTRESPONSE._serialized_end=161 + _GETVALIDATORADDRESSESREQUEST._serialized_start=163 + _GETVALIDATORADDRESSESREQUEST._serialized_end=193 + _GETVALIDATORADDRESSESRESPONSE._serialized_start=195 + _GETVALIDATORADDRESSESRESPONSE._serialized_end=256 + _GETVALIDATORREQUEST._serialized_start=258 + _GETVALIDATORREQUEST._serialized_end=305 + _GETVALIDATORBYNUMBERREQUEST._serialized_start=307 + _GETVALIDATORBYNUMBERREQUEST._serialized_end=360 + _GETVALIDATORRESPONSE._serialized_start=362 + _GETVALIDATORRESPONSE._serialized_end=437 + _GETPUBLICKEYREQUEST._serialized_start=439 + _GETPUBLICKEYREQUEST._serialized_end=486 + _GETPUBLICKEYRESPONSE._serialized_start=488 + _GETPUBLICKEYRESPONSE._serialized_end=541 + _GETBLOCKREQUEST._serialized_start=543 + _GETBLOCKREQUEST._serialized_end=638 + _GETBLOCKRESPONSE._serialized_start=641 + _GETBLOCKRESPONSE._serialized_end=900 + _GETBLOCKHASHREQUEST._serialized_start=902 + _GETBLOCKHASHREQUEST._serialized_end=947 + _GETBLOCKHASHRESPONSE._serialized_start=949 + _GETBLOCKHASHRESPONSE._serialized_end=991 + _GETBLOCKHEIGHTREQUEST._serialized_start=993 + _GETBLOCKHEIGHTREQUEST._serialized_end=1036 + _GETBLOCKHEIGHTRESPONSE._serialized_start=1038 + _GETBLOCKHEIGHTRESPONSE._serialized_end=1086 + _GETBLOCKCHAININFOREQUEST._serialized_start=1088 + _GETBLOCKCHAININFOREQUEST._serialized_end=1114 + _GETBLOCKCHAININFORESPONSE._serialized_start=1117 + _GETBLOCKCHAININFORESPONSE._serialized_end=1566 + _GETCONSENSUSINFOREQUEST._serialized_start=1568 + _GETCONSENSUSINFOREQUEST._serialized_end=1593 + _GETCONSENSUSINFORESPONSE._serialized_start=1596 + _GETCONSENSUSINFORESPONSE._serialized_end=1725 + _GETTXPOOLCONTENTREQUEST._serialized_start=1727 + _GETTXPOOLCONTENTREQUEST._serialized_end=1808 + _GETTXPOOLCONTENTRESPONSE._serialized_start=1810 + _GETTXPOOLCONTENTRESPONSE._serialized_end=1879 + _VALIDATORINFO._serialized_start=1882 + _VALIDATORINFO._serialized_end=2230 + _ACCOUNTINFO._serialized_start=2233 + _ACCOUNTINFO._serialized_end=2362 + _BLOCKHEADERINFO._serialized_start=2365 + _BLOCKHEADERINFO._serialized_end=2561 + _CERTIFICATEINFO._serialized_start=2564 + _CERTIFICATEINFO._serialized_end=2715 + _VOTEINFO._serialized_start=2718 + _VOTEINFO._serialized_end=2895 + _CONSENSUSINFO._serialized_start=2898 + _CONSENSUSINFO._serialized_end=3049 + _PROPOSALINFO._serialized_start=3051 + _PROPOSALINFO._serialized_end=3172 + _BLOCKCHAIN._serialized_start=3343 + _BLOCKCHAIN._serialized_end=4250 # @@protoc_insertion_point(module_scope) diff --git a/pactus/rpc/blockchain_pb2.pyi b/pactus/rpc/blockchain_pb2.pyi index 492e121..97d1615 100644 --- a/pactus/rpc/blockchain_pb2.pyi +++ b/pactus/rpc/blockchain_pb2.pyi @@ -3,13 +3,7 @@ from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor @@ -25,7 +19,6 @@ class VoteType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): VOTE_PREPARE: _ClassVar[VoteType] VOTE_PRECOMMIT: _ClassVar[VoteType] VOTE_CHANGE_PROPOSER: _ClassVar[VoteType] - BLOCK_DATA: BlockVerbosity BLOCK_INFO: BlockVerbosity BLOCK_TRANSACTIONS: BlockVerbosity @@ -44,9 +37,7 @@ class GetAccountResponse(_message.Message): __slots__ = ("account",) ACCOUNT_FIELD_NUMBER: _ClassVar[int] account: AccountInfo - def __init__( - self, account: _Optional[_Union[AccountInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, account: _Optional[_Union[AccountInfo, _Mapping]] = ...) -> None: ... class GetValidatorAddressesRequest(_message.Message): __slots__ = () @@ -74,9 +65,7 @@ class GetValidatorResponse(_message.Message): __slots__ = ("validator",) VALIDATOR_FIELD_NUMBER: _ClassVar[int] validator: ValidatorInfo - def __init__( - self, validator: _Optional[_Union[ValidatorInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, validator: _Optional[_Union[ValidatorInfo, _Mapping]] = ...) -> None: ... class GetPublicKeyRequest(_message.Message): __slots__ = ("address",) @@ -96,11 +85,7 @@ class GetBlockRequest(_message.Message): VERBOSITY_FIELD_NUMBER: _ClassVar[int] height: int verbosity: BlockVerbosity - def __init__( - self, - height: _Optional[int] = ..., - verbosity: _Optional[_Union[BlockVerbosity, str]] = ..., - ) -> None: ... + def __init__(self, height: _Optional[int] = ..., verbosity: _Optional[_Union[BlockVerbosity, str]] = ...) -> None: ... class GetBlockResponse(_message.Message): __slots__ = ("height", "hash", "data", "block_time", "header", "prev_cert", "txs") @@ -118,18 +103,7 @@ class GetBlockResponse(_message.Message): header: BlockHeaderInfo prev_cert: CertificateInfo txs: _containers.RepeatedCompositeFieldContainer[_transaction_pb2.TransactionInfo] - def __init__( - self, - height: _Optional[int] = ..., - hash: _Optional[str] = ..., - data: _Optional[str] = ..., - block_time: _Optional[int] = ..., - header: _Optional[_Union[BlockHeaderInfo, _Mapping]] = ..., - prev_cert: _Optional[_Union[CertificateInfo, _Mapping]] = ..., - txs: _Optional[ - _Iterable[_Union[_transaction_pb2.TransactionInfo, _Mapping]] - ] = ..., - ) -> None: ... + def __init__(self, height: _Optional[int] = ..., hash: _Optional[str] = ..., data: _Optional[str] = ..., block_time: _Optional[int] = ..., header: _Optional[_Union[BlockHeaderInfo, _Mapping]] = ..., prev_cert: _Optional[_Union[CertificateInfo, _Mapping]] = ..., txs: _Optional[_Iterable[_Union[_transaction_pb2.TransactionInfo, _Mapping]]] = ...) -> None: ... class GetBlockHashRequest(_message.Message): __slots__ = ("height",) @@ -160,18 +134,7 @@ class GetBlockchainInfoRequest(_message.Message): def __init__(self) -> None: ... class GetBlockchainInfoResponse(_message.Message): - __slots__ = ( - "last_block_height", - "last_block_hash", - "total_accounts", - "total_validators", - "total_power", - "committee_power", - "committee_validators", - "is_pruned", - "pruning_height", - "last_block_time", - ) + __slots__ = ("last_block_height", "last_block_hash", "total_accounts", "total_validators", "total_power", "committee_power", "committee_validators", "is_pruned", "pruning_height", "last_block_time") LAST_BLOCK_HEIGHT_FIELD_NUMBER: _ClassVar[int] LAST_BLOCK_HASH_FIELD_NUMBER: _ClassVar[int] TOTAL_ACCOUNTS_FIELD_NUMBER: _ClassVar[int] @@ -192,66 +155,34 @@ class GetBlockchainInfoResponse(_message.Message): is_pruned: bool pruning_height: int last_block_time: int - def __init__( - self, - last_block_height: _Optional[int] = ..., - last_block_hash: _Optional[str] = ..., - total_accounts: _Optional[int] = ..., - total_validators: _Optional[int] = ..., - total_power: _Optional[int] = ..., - committee_power: _Optional[int] = ..., - committee_validators: _Optional[ - _Iterable[_Union[ValidatorInfo, _Mapping]] - ] = ..., - is_pruned: bool = ..., - pruning_height: _Optional[int] = ..., - last_block_time: _Optional[int] = ..., - ) -> None: ... + def __init__(self, last_block_height: _Optional[int] = ..., last_block_hash: _Optional[str] = ..., total_accounts: _Optional[int] = ..., total_validators: _Optional[int] = ..., total_power: _Optional[int] = ..., committee_power: _Optional[int] = ..., committee_validators: _Optional[_Iterable[_Union[ValidatorInfo, _Mapping]]] = ..., is_pruned: bool = ..., pruning_height: _Optional[int] = ..., last_block_time: _Optional[int] = ...) -> None: ... class GetConsensusInfoRequest(_message.Message): __slots__ = () def __init__(self) -> None: ... class GetConsensusInfoResponse(_message.Message): - __slots__ = ("instances",) + __slots__ = ("proposal", "instances") + PROPOSAL_FIELD_NUMBER: _ClassVar[int] INSTANCES_FIELD_NUMBER: _ClassVar[int] + proposal: ProposalInfo instances: _containers.RepeatedCompositeFieldContainer[ConsensusInfo] - def __init__( - self, instances: _Optional[_Iterable[_Union[ConsensusInfo, _Mapping]]] = ... - ) -> None: ... + def __init__(self, proposal: _Optional[_Union[ProposalInfo, _Mapping]] = ..., instances: _Optional[_Iterable[_Union[ConsensusInfo, _Mapping]]] = ...) -> None: ... class GetTxPoolContentRequest(_message.Message): __slots__ = ("payload_type",) PAYLOAD_TYPE_FIELD_NUMBER: _ClassVar[int] payload_type: _transaction_pb2.PayloadType - def __init__( - self, payload_type: _Optional[_Union[_transaction_pb2.PayloadType, str]] = ... - ) -> None: ... + def __init__(self, payload_type: _Optional[_Union[_transaction_pb2.PayloadType, str]] = ...) -> None: ... class GetTxPoolContentResponse(_message.Message): __slots__ = ("txs",) TXS_FIELD_NUMBER: _ClassVar[int] txs: _containers.RepeatedCompositeFieldContainer[_transaction_pb2.TransactionInfo] - def __init__( - self, - txs: _Optional[ - _Iterable[_Union[_transaction_pb2.TransactionInfo, _Mapping]] - ] = ..., - ) -> None: ... + def __init__(self, txs: _Optional[_Iterable[_Union[_transaction_pb2.TransactionInfo, _Mapping]]] = ...) -> None: ... class ValidatorInfo(_message.Message): - __slots__ = ( - "hash", - "data", - "public_key", - "number", - "stake", - "last_bonding_height", - "last_sortition_height", - "unbonding_height", - "address", - "availability_score", - ) + __slots__ = ("hash", "data", "public_key", "number", "stake", "last_bonding_height", "last_sortition_height", "unbonding_height", "address", "availability_score") HASH_FIELD_NUMBER: _ClassVar[int] DATA_FIELD_NUMBER: _ClassVar[int] PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] @@ -272,19 +203,7 @@ class ValidatorInfo(_message.Message): unbonding_height: int address: str availability_score: float - def __init__( - self, - hash: _Optional[str] = ..., - data: _Optional[str] = ..., - public_key: _Optional[str] = ..., - number: _Optional[int] = ..., - stake: _Optional[int] = ..., - last_bonding_height: _Optional[int] = ..., - last_sortition_height: _Optional[int] = ..., - unbonding_height: _Optional[int] = ..., - address: _Optional[str] = ..., - availability_score: _Optional[float] = ..., - ) -> None: ... + def __init__(self, hash: _Optional[str] = ..., data: _Optional[str] = ..., public_key: _Optional[str] = ..., number: _Optional[int] = ..., stake: _Optional[int] = ..., last_bonding_height: _Optional[int] = ..., last_sortition_height: _Optional[int] = ..., unbonding_height: _Optional[int] = ..., address: _Optional[str] = ..., availability_score: _Optional[float] = ...) -> None: ... class AccountInfo(_message.Message): __slots__ = ("hash", "data", "number", "balance", "address") @@ -298,23 +217,10 @@ class AccountInfo(_message.Message): number: int balance: int address: str - def __init__( - self, - hash: _Optional[str] = ..., - data: _Optional[str] = ..., - number: _Optional[int] = ..., - balance: _Optional[int] = ..., - address: _Optional[str] = ..., - ) -> None: ... + def __init__(self, hash: _Optional[str] = ..., data: _Optional[str] = ..., number: _Optional[int] = ..., balance: _Optional[int] = ..., address: _Optional[str] = ...) -> None: ... class BlockHeaderInfo(_message.Message): - __slots__ = ( - "version", - "prev_block_hash", - "state_root", - "sortition_seed", - "proposer_address", - ) + __slots__ = ("version", "prev_block_hash", "state_root", "sortition_seed", "proposer_address") VERSION_FIELD_NUMBER: _ClassVar[int] PREV_BLOCK_HASH_FIELD_NUMBER: _ClassVar[int] STATE_ROOT_FIELD_NUMBER: _ClassVar[int] @@ -325,14 +231,7 @@ class BlockHeaderInfo(_message.Message): state_root: str sortition_seed: str proposer_address: str - def __init__( - self, - version: _Optional[int] = ..., - prev_block_hash: _Optional[str] = ..., - state_root: _Optional[str] = ..., - sortition_seed: _Optional[str] = ..., - proposer_address: _Optional[str] = ..., - ) -> None: ... + def __init__(self, version: _Optional[int] = ..., prev_block_hash: _Optional[str] = ..., state_root: _Optional[str] = ..., sortition_seed: _Optional[str] = ..., proposer_address: _Optional[str] = ...) -> None: ... class CertificateInfo(_message.Message): __slots__ = ("hash", "round", "committers", "absentees", "signature") @@ -346,14 +245,7 @@ class CertificateInfo(_message.Message): committers: _containers.RepeatedScalarFieldContainer[int] absentees: _containers.RepeatedScalarFieldContainer[int] signature: str - def __init__( - self, - hash: _Optional[str] = ..., - round: _Optional[int] = ..., - committers: _Optional[_Iterable[int]] = ..., - absentees: _Optional[_Iterable[int]] = ..., - signature: _Optional[str] = ..., - ) -> None: ... + def __init__(self, hash: _Optional[str] = ..., round: _Optional[int] = ..., committers: _Optional[_Iterable[int]] = ..., absentees: _Optional[_Iterable[int]] = ..., signature: _Optional[str] = ...) -> None: ... class VoteInfo(_message.Message): __slots__ = ("type", "voter", "block_hash", "round", "cp_round", "cp_value") @@ -369,15 +261,7 @@ class VoteInfo(_message.Message): round: int cp_round: int cp_value: int - def __init__( - self, - type: _Optional[_Union[VoteType, str]] = ..., - voter: _Optional[str] = ..., - block_hash: _Optional[str] = ..., - round: _Optional[int] = ..., - cp_round: _Optional[int] = ..., - cp_value: _Optional[int] = ..., - ) -> None: ... + def __init__(self, type: _Optional[_Union[VoteType, str]] = ..., voter: _Optional[str] = ..., block_hash: _Optional[str] = ..., round: _Optional[int] = ..., cp_round: _Optional[int] = ..., cp_value: _Optional[int] = ...) -> None: ... class ConsensusInfo(_message.Message): __slots__ = ("address", "active", "height", "round", "votes") @@ -391,11 +275,16 @@ class ConsensusInfo(_message.Message): height: int round: int votes: _containers.RepeatedCompositeFieldContainer[VoteInfo] - def __init__( - self, - address: _Optional[str] = ..., - active: bool = ..., - height: _Optional[int] = ..., - round: _Optional[int] = ..., - votes: _Optional[_Iterable[_Union[VoteInfo, _Mapping]]] = ..., - ) -> None: ... + def __init__(self, address: _Optional[str] = ..., active: bool = ..., height: _Optional[int] = ..., round: _Optional[int] = ..., votes: _Optional[_Iterable[_Union[VoteInfo, _Mapping]]] = ...) -> None: ... + +class ProposalInfo(_message.Message): + __slots__ = ("height", "round", "block_data", "signature") + HEIGHT_FIELD_NUMBER: _ClassVar[int] + ROUND_FIELD_NUMBER: _ClassVar[int] + BLOCK_DATA_FIELD_NUMBER: _ClassVar[int] + SIGNATURE_FIELD_NUMBER: _ClassVar[int] + height: int + round: int + block_data: str + signature: str + def __init__(self, height: _Optional[int] = ..., round: _Optional[int] = ..., block_data: _Optional[str] = ..., signature: _Optional[str] = ...) -> None: ... diff --git a/pactus/rpc/blockchain_pb2_grpc.py b/pactus/rpc/blockchain_pb2_grpc.py index c1e2d0e..e10c16a 100644 --- a/pactus/rpc/blockchain_pb2_grpc.py +++ b/pactus/rpc/blockchain_pb2_grpc.py @@ -1,13 +1,13 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" - import grpc from . import blockchain_pb2 as blockchain__pb2 class BlockchainStub(object): - """Blockchain service defines RPC methods for interacting with the blockchain.""" + """Blockchain service defines RPC methods for interacting with the blockchain. + """ def __init__(self, channel): """Constructor. @@ -16,525 +16,400 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.GetBlock = channel.unary_unary( - "/pactus.Blockchain/GetBlock", - request_serializer=blockchain__pb2.GetBlockRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetBlockResponse.FromString, - ) + '/pactus.Blockchain/GetBlock', + request_serializer=blockchain__pb2.GetBlockRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetBlockResponse.FromString, + ) self.GetBlockHash = channel.unary_unary( - "/pactus.Blockchain/GetBlockHash", - request_serializer=blockchain__pb2.GetBlockHashRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetBlockHashResponse.FromString, - ) + '/pactus.Blockchain/GetBlockHash', + request_serializer=blockchain__pb2.GetBlockHashRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetBlockHashResponse.FromString, + ) self.GetBlockHeight = channel.unary_unary( - "/pactus.Blockchain/GetBlockHeight", - request_serializer=blockchain__pb2.GetBlockHeightRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetBlockHeightResponse.FromString, - ) + '/pactus.Blockchain/GetBlockHeight', + request_serializer=blockchain__pb2.GetBlockHeightRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetBlockHeightResponse.FromString, + ) self.GetBlockchainInfo = channel.unary_unary( - "/pactus.Blockchain/GetBlockchainInfo", - request_serializer=blockchain__pb2.GetBlockchainInfoRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetBlockchainInfoResponse.FromString, - ) + '/pactus.Blockchain/GetBlockchainInfo', + request_serializer=blockchain__pb2.GetBlockchainInfoRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetBlockchainInfoResponse.FromString, + ) self.GetConsensusInfo = channel.unary_unary( - "/pactus.Blockchain/GetConsensusInfo", - request_serializer=blockchain__pb2.GetConsensusInfoRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetConsensusInfoResponse.FromString, - ) + '/pactus.Blockchain/GetConsensusInfo', + request_serializer=blockchain__pb2.GetConsensusInfoRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetConsensusInfoResponse.FromString, + ) self.GetAccount = channel.unary_unary( - "/pactus.Blockchain/GetAccount", - request_serializer=blockchain__pb2.GetAccountRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetAccountResponse.FromString, - ) + '/pactus.Blockchain/GetAccount', + request_serializer=blockchain__pb2.GetAccountRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetAccountResponse.FromString, + ) self.GetValidator = channel.unary_unary( - "/pactus.Blockchain/GetValidator", - request_serializer=blockchain__pb2.GetValidatorRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetValidatorResponse.FromString, - ) + '/pactus.Blockchain/GetValidator', + request_serializer=blockchain__pb2.GetValidatorRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetValidatorResponse.FromString, + ) self.GetValidatorByNumber = channel.unary_unary( - "/pactus.Blockchain/GetValidatorByNumber", - request_serializer=blockchain__pb2.GetValidatorByNumberRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetValidatorResponse.FromString, - ) + '/pactus.Blockchain/GetValidatorByNumber', + request_serializer=blockchain__pb2.GetValidatorByNumberRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetValidatorResponse.FromString, + ) self.GetValidatorAddresses = channel.unary_unary( - "/pactus.Blockchain/GetValidatorAddresses", - request_serializer=blockchain__pb2.GetValidatorAddressesRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetValidatorAddressesResponse.FromString, - ) + '/pactus.Blockchain/GetValidatorAddresses', + request_serializer=blockchain__pb2.GetValidatorAddressesRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetValidatorAddressesResponse.FromString, + ) self.GetPublicKey = channel.unary_unary( - "/pactus.Blockchain/GetPublicKey", - request_serializer=blockchain__pb2.GetPublicKeyRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetPublicKeyResponse.FromString, - ) + '/pactus.Blockchain/GetPublicKey', + request_serializer=blockchain__pb2.GetPublicKeyRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetPublicKeyResponse.FromString, + ) self.GetTxPoolContent = channel.unary_unary( - "/pactus.Blockchain/GetTxPoolContent", - request_serializer=blockchain__pb2.GetTxPoolContentRequest.SerializeToString, - response_deserializer=blockchain__pb2.GetTxPoolContentResponse.FromString, - ) + '/pactus.Blockchain/GetTxPoolContent', + request_serializer=blockchain__pb2.GetTxPoolContentRequest.SerializeToString, + response_deserializer=blockchain__pb2.GetTxPoolContentResponse.FromString, + ) class BlockchainServicer(object): - """Blockchain service defines RPC methods for interacting with the blockchain.""" + """Blockchain service defines RPC methods for interacting with the blockchain. + """ def GetBlock(self, request, context): """GetBlock retrieves information about a block based on the provided request parameters. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetBlockHash(self, request, context): - """GetBlockHash retrieves the hash of a block at the specified height.""" + """GetBlockHash retrieves the hash of a block at the specified height. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetBlockHeight(self, request, context): - """GetBlockHeight retrieves the height of a block with the specified hash.""" + """GetBlockHeight retrieves the height of a block with the specified hash. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetBlockchainInfo(self, request, context): - """GetBlockchainInfo retrieves general information about the blockchain.""" + """GetBlockchainInfo retrieves general information about the blockchain. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetConsensusInfo(self, request, context): - """GetConsensusInfo retrieves information about the consensus instances.""" + """GetConsensusInfo retrieves information about the consensus instances. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetAccount(self, request, context): """GetAccount retrieves information about an account based on the provided address. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetValidator(self, request, context): """GetValidator retrieves information about a validator based on the provided address. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetValidatorByNumber(self, request, context): """GetValidatorByNumber retrieves information about a validator based on the provided number. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetValidatorAddresses(self, request, context): - """GetValidatorAddresses retrieves a list of all validator addresses.""" + """GetValidatorAddresses retrieves a list of all validator addresses. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetPublicKey(self, request, context): """GetPublicKey retrieves the public key of an account based on the provided address. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetTxPoolContent(self, request, context): - """GetTxPoolContent retrieves current transactions in the transaction pool.""" + """GetTxPoolContent retrieves current transactions in the transaction pool. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_BlockchainServicer_to_server(servicer, server): rpc_method_handlers = { - "GetBlock": grpc.unary_unary_rpc_method_handler( - servicer.GetBlock, - request_deserializer=blockchain__pb2.GetBlockRequest.FromString, - response_serializer=blockchain__pb2.GetBlockResponse.SerializeToString, - ), - "GetBlockHash": grpc.unary_unary_rpc_method_handler( - servicer.GetBlockHash, - request_deserializer=blockchain__pb2.GetBlockHashRequest.FromString, - response_serializer=blockchain__pb2.GetBlockHashResponse.SerializeToString, - ), - "GetBlockHeight": grpc.unary_unary_rpc_method_handler( - servicer.GetBlockHeight, - request_deserializer=blockchain__pb2.GetBlockHeightRequest.FromString, - response_serializer=blockchain__pb2.GetBlockHeightResponse.SerializeToString, - ), - "GetBlockchainInfo": grpc.unary_unary_rpc_method_handler( - servicer.GetBlockchainInfo, - request_deserializer=blockchain__pb2.GetBlockchainInfoRequest.FromString, - response_serializer=blockchain__pb2.GetBlockchainInfoResponse.SerializeToString, - ), - "GetConsensusInfo": grpc.unary_unary_rpc_method_handler( - servicer.GetConsensusInfo, - request_deserializer=blockchain__pb2.GetConsensusInfoRequest.FromString, - response_serializer=blockchain__pb2.GetConsensusInfoResponse.SerializeToString, - ), - "GetAccount": grpc.unary_unary_rpc_method_handler( - servicer.GetAccount, - request_deserializer=blockchain__pb2.GetAccountRequest.FromString, - response_serializer=blockchain__pb2.GetAccountResponse.SerializeToString, - ), - "GetValidator": grpc.unary_unary_rpc_method_handler( - servicer.GetValidator, - request_deserializer=blockchain__pb2.GetValidatorRequest.FromString, - response_serializer=blockchain__pb2.GetValidatorResponse.SerializeToString, - ), - "GetValidatorByNumber": grpc.unary_unary_rpc_method_handler( - servicer.GetValidatorByNumber, - request_deserializer=blockchain__pb2.GetValidatorByNumberRequest.FromString, - response_serializer=blockchain__pb2.GetValidatorResponse.SerializeToString, - ), - "GetValidatorAddresses": grpc.unary_unary_rpc_method_handler( - servicer.GetValidatorAddresses, - request_deserializer=blockchain__pb2.GetValidatorAddressesRequest.FromString, - response_serializer=blockchain__pb2.GetValidatorAddressesResponse.SerializeToString, - ), - "GetPublicKey": grpc.unary_unary_rpc_method_handler( - servicer.GetPublicKey, - request_deserializer=blockchain__pb2.GetPublicKeyRequest.FromString, - response_serializer=blockchain__pb2.GetPublicKeyResponse.SerializeToString, - ), - "GetTxPoolContent": grpc.unary_unary_rpc_method_handler( - servicer.GetTxPoolContent, - request_deserializer=blockchain__pb2.GetTxPoolContentRequest.FromString, - response_serializer=blockchain__pb2.GetTxPoolContentResponse.SerializeToString, - ), + 'GetBlock': grpc.unary_unary_rpc_method_handler( + servicer.GetBlock, + request_deserializer=blockchain__pb2.GetBlockRequest.FromString, + response_serializer=blockchain__pb2.GetBlockResponse.SerializeToString, + ), + 'GetBlockHash': grpc.unary_unary_rpc_method_handler( + servicer.GetBlockHash, + request_deserializer=blockchain__pb2.GetBlockHashRequest.FromString, + response_serializer=blockchain__pb2.GetBlockHashResponse.SerializeToString, + ), + 'GetBlockHeight': grpc.unary_unary_rpc_method_handler( + servicer.GetBlockHeight, + request_deserializer=blockchain__pb2.GetBlockHeightRequest.FromString, + response_serializer=blockchain__pb2.GetBlockHeightResponse.SerializeToString, + ), + 'GetBlockchainInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetBlockchainInfo, + request_deserializer=blockchain__pb2.GetBlockchainInfoRequest.FromString, + response_serializer=blockchain__pb2.GetBlockchainInfoResponse.SerializeToString, + ), + 'GetConsensusInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetConsensusInfo, + request_deserializer=blockchain__pb2.GetConsensusInfoRequest.FromString, + response_serializer=blockchain__pb2.GetConsensusInfoResponse.SerializeToString, + ), + 'GetAccount': grpc.unary_unary_rpc_method_handler( + servicer.GetAccount, + request_deserializer=blockchain__pb2.GetAccountRequest.FromString, + response_serializer=blockchain__pb2.GetAccountResponse.SerializeToString, + ), + 'GetValidator': grpc.unary_unary_rpc_method_handler( + servicer.GetValidator, + request_deserializer=blockchain__pb2.GetValidatorRequest.FromString, + response_serializer=blockchain__pb2.GetValidatorResponse.SerializeToString, + ), + 'GetValidatorByNumber': grpc.unary_unary_rpc_method_handler( + servicer.GetValidatorByNumber, + request_deserializer=blockchain__pb2.GetValidatorByNumberRequest.FromString, + response_serializer=blockchain__pb2.GetValidatorResponse.SerializeToString, + ), + 'GetValidatorAddresses': grpc.unary_unary_rpc_method_handler( + servicer.GetValidatorAddresses, + request_deserializer=blockchain__pb2.GetValidatorAddressesRequest.FromString, + response_serializer=blockchain__pb2.GetValidatorAddressesResponse.SerializeToString, + ), + 'GetPublicKey': grpc.unary_unary_rpc_method_handler( + servicer.GetPublicKey, + request_deserializer=blockchain__pb2.GetPublicKeyRequest.FromString, + response_serializer=blockchain__pb2.GetPublicKeyResponse.SerializeToString, + ), + 'GetTxPoolContent': grpc.unary_unary_rpc_method_handler( + servicer.GetTxPoolContent, + request_deserializer=blockchain__pb2.GetTxPoolContentRequest.FromString, + response_serializer=blockchain__pb2.GetTxPoolContentResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - "pactus.Blockchain", rpc_method_handlers - ) + 'pactus.Blockchain', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) -# This class is part of an EXPERIMENTAL API. + # This class is part of an EXPERIMENTAL API. class Blockchain(object): - """Blockchain service defines RPC methods for interacting with the blockchain.""" + """Blockchain service defines RPC methods for interacting with the blockchain. + """ @staticmethod - def GetBlock( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetBlock(request, target, - "/pactus.Blockchain/GetBlock", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetBlock', blockchain__pb2.GetBlockRequest.SerializeToString, blockchain__pb2.GetBlockResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetBlockHash( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetBlockHash(request, target, - "/pactus.Blockchain/GetBlockHash", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetBlockHash', blockchain__pb2.GetBlockHashRequest.SerializeToString, blockchain__pb2.GetBlockHashResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetBlockHeight( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetBlockHeight(request, target, - "/pactus.Blockchain/GetBlockHeight", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetBlockHeight', blockchain__pb2.GetBlockHeightRequest.SerializeToString, blockchain__pb2.GetBlockHeightResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetBlockchainInfo( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetBlockchainInfo(request, target, - "/pactus.Blockchain/GetBlockchainInfo", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetBlockchainInfo', blockchain__pb2.GetBlockchainInfoRequest.SerializeToString, blockchain__pb2.GetBlockchainInfoResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetConsensusInfo( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetConsensusInfo(request, target, - "/pactus.Blockchain/GetConsensusInfo", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetConsensusInfo', blockchain__pb2.GetConsensusInfoRequest.SerializeToString, blockchain__pb2.GetConsensusInfoResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetAccount( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetAccount(request, target, - "/pactus.Blockchain/GetAccount", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetAccount', blockchain__pb2.GetAccountRequest.SerializeToString, blockchain__pb2.GetAccountResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetValidator( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetValidator(request, target, - "/pactus.Blockchain/GetValidator", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetValidator', blockchain__pb2.GetValidatorRequest.SerializeToString, blockchain__pb2.GetValidatorResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetValidatorByNumber( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetValidatorByNumber(request, target, - "/pactus.Blockchain/GetValidatorByNumber", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetValidatorByNumber', blockchain__pb2.GetValidatorByNumberRequest.SerializeToString, blockchain__pb2.GetValidatorResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetValidatorAddresses( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetValidatorAddresses(request, target, - "/pactus.Blockchain/GetValidatorAddresses", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetValidatorAddresses', blockchain__pb2.GetValidatorAddressesRequest.SerializeToString, blockchain__pb2.GetValidatorAddressesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetPublicKey( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetPublicKey(request, target, - "/pactus.Blockchain/GetPublicKey", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetPublicKey', blockchain__pb2.GetPublicKeyRequest.SerializeToString, blockchain__pb2.GetPublicKeyResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetTxPoolContent( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetTxPoolContent(request, target, - "/pactus.Blockchain/GetTxPoolContent", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetTxPoolContent', blockchain__pb2.GetTxPoolContentRequest.SerializeToString, blockchain__pb2.GetTxPoolContentResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pactus/rpc/network_pb2.py b/pactus/rpc/network_pb2.py index d6cdc12..656347c 100644 --- a/pactus/rpc/network_pb2.py +++ b/pactus/rpc/network_pb2.py @@ -2,7 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: network.proto """Generated protocol buffer code.""" - from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,45 +11,40 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\rnetwork.proto\x12\x06pactus">\n\x15GetNetworkInfoRequest\x12%\n\x0eonly_connected\x18\x01 \x01(\x08R\ronlyConnected"\xae\x04\n\x16GetNetworkInfoResponse\x12!\n\x0cnetwork_name\x18\x01 \x01(\tR\x0bnetworkName\x12(\n\x10total_sent_bytes\x18\x02 \x01(\x03R\x0etotalSentBytes\x12\x30\n\x14total_received_bytes\x18\x03 \x01(\x03R\x12totalReceivedBytes\x12\x32\n\x15\x63onnected_peers_count\x18\x04 \x01(\rR\x13\x63onnectedPeersCount\x12\x39\n\x0f\x63onnected_peers\x18\x05 \x03(\x0b\x32\x10.pactus.PeerInfoR\x0e\x63onnectedPeers\x12L\n\nsent_bytes\x18\x06 \x03(\x0b\x32-.pactus.GetNetworkInfoResponse.SentBytesEntryR\tsentBytes\x12X\n\x0ereceived_bytes\x18\x07 \x03(\x0b\x32\x31.pactus.GetNetworkInfoResponse.ReceivedBytesEntryR\rreceivedBytes\x1a<\n\x0eSentBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\x1a@\n\x12ReceivedBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01"\x14\n\x12GetNodeInfoRequest"\x87\x03\n\x13GetNodeInfoResponse\x12\x18\n\x07moniker\x18\x01 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x02 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x03 \x01(\tR\x06peerId\x12\x1d\n\nstarted_at\x18\x04 \x01(\x04R\tstartedAt\x12"\n\x0creachability\x18\x05 \x01(\tR\x0creachability\x12\x1a\n\x08services\x18\x06 \x01(\x05R\x08services\x12%\n\x0eservices_names\x18\x07 \x01(\tR\rservicesNames\x12\x1f\n\x0blocal_addrs\x18\x08 \x03(\tR\nlocalAddrs\x12\x1c\n\tprotocols\x18\t \x03(\tR\tprotocols\x12!\n\x0c\x63lock_offset\x18\r \x01(\x01R\x0b\x63lockOffset\x12?\n\x0f\x63onnection_info\x18\x0e \x01(\x0b\x32\x16.pactus.ConnectionInfoR\x0e\x63onnectionInfo"\xed\x06\n\x08PeerInfo\x12\x16\n\x06status\x18\x01 \x01(\x05R\x06status\x12\x18\n\x07moniker\x18\x02 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x03 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x04 \x01(\tR\x06peerId\x12%\n\x0e\x63onsensus_keys\x18\x05 \x03(\tR\rconsensusKeys\x12/\n\x13\x63onsensus_addresses\x18\x06 \x03(\tR\x12\x63onsensusAddresses\x12\x1a\n\x08services\x18\x07 \x01(\rR\x08services\x12&\n\x0flast_block_hash\x18\x08 \x01(\tR\rlastBlockHash\x12\x16\n\x06height\x18\t \x01(\rR\x06height\x12)\n\x10received_bundles\x18\n \x01(\x05R\x0freceivedBundles\x12\'\n\x0finvalid_bundles\x18\x0b \x01(\x05R\x0einvalidBundles\x12\x1b\n\tlast_sent\x18\x0c \x01(\x03R\x08lastSent\x12#\n\rlast_received\x18\r \x01(\x03R\x0clastReceived\x12>\n\nsent_bytes\x18\x0e \x03(\x0b\x32\x1f.pactus.PeerInfo.SentBytesEntryR\tsentBytes\x12J\n\x0ereceived_bytes\x18\x0f \x03(\x0b\x32#.pactus.PeerInfo.ReceivedBytesEntryR\rreceivedBytes\x12\x18\n\x07\x61\x64\x64ress\x18\x10 \x01(\tR\x07\x61\x64\x64ress\x12\x1c\n\tdirection\x18\x11 \x01(\tR\tdirection\x12\x1c\n\tprotocols\x18\x12 \x03(\tR\tprotocols\x12%\n\x0etotal_sessions\x18\x13 \x01(\x05R\rtotalSessions\x12-\n\x12\x63ompleted_sessions\x18\x14 \x01(\x05R\x11\x63ompletedSessions\x1a<\n\x0eSentBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\x1a@\n\x12ReceivedBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01"\x96\x01\n\x0e\x43onnectionInfo\x12 \n\x0b\x63onnections\x18\x01 \x01(\x04R\x0b\x63onnections\x12/\n\x13inbound_connections\x18\x02 \x01(\x04R\x12inboundConnections\x12\x31\n\x14outbound_connections\x18\x03 \x01(\x04R\x13outboundConnections2\xa2\x01\n\x07Network\x12O\n\x0eGetNetworkInfo\x12\x1d.pactus.GetNetworkInfoRequest\x1a\x1e.pactus.GetNetworkInfoResponse\x12\x46\n\x0bGetNodeInfo\x12\x1a.pactus.GetNodeInfoRequest\x1a\x1b.pactus.GetNodeInfoResponseBB\n\x0epactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3' -) + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rnetwork.proto\x12\x06pactus\">\n\x15GetNetworkInfoRequest\x12%\n\x0eonly_connected\x18\x01 \x01(\x08R\ronlyConnected\"\xdf\x01\n\x16GetNetworkInfoResponse\x12!\n\x0cnetwork_name\x18\x01 \x01(\tR\x0bnetworkName\x12\x32\n\x15\x63onnected_peers_count\x18\x02 \x01(\rR\x13\x63onnectedPeersCount\x12\x39\n\x0f\x63onnected_peers\x18\x03 \x03(\x0b\x32\x10.pactus.PeerInfoR\x0e\x63onnectedPeers\x12\x33\n\x0bmetric_info\x18\x04 \x01(\x0b\x32\x12.pactus.MetricInfoR\nmetricInfo\"\x14\n\x12GetNodeInfoRequest\"\x87\x03\n\x13GetNodeInfoResponse\x12\x18\n\x07moniker\x18\x01 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x02 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x03 \x01(\tR\x06peerId\x12\x1d\n\nstarted_at\x18\x04 \x01(\x04R\tstartedAt\x12\"\n\x0creachability\x18\x05 \x01(\tR\x0creachability\x12\x1a\n\x08services\x18\x06 \x01(\x05R\x08services\x12%\n\x0eservices_names\x18\x07 \x01(\tR\rservicesNames\x12\x1f\n\x0blocal_addrs\x18\x08 \x03(\tR\nlocalAddrs\x12\x1c\n\tprotocols\x18\t \x03(\tR\tprotocols\x12!\n\x0c\x63lock_offset\x18\r \x01(\x01R\x0b\x63lockOffset\x12?\n\x0f\x63onnection_info\x18\x0e \x01(\x0b\x32\x16.pactus.ConnectionInfoR\x0e\x63onnectionInfo\"\xc2\x04\n\x08PeerInfo\x12\x16\n\x06status\x18\x01 \x01(\x05R\x06status\x12\x18\n\x07moniker\x18\x02 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x03 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x04 \x01(\tR\x06peerId\x12%\n\x0e\x63onsensus_keys\x18\x05 \x03(\tR\rconsensusKeys\x12/\n\x13\x63onsensus_addresses\x18\x06 \x03(\tR\x12\x63onsensusAddresses\x12\x1a\n\x08services\x18\x07 \x01(\rR\x08services\x12&\n\x0flast_block_hash\x18\x08 \x01(\tR\rlastBlockHash\x12\x16\n\x06height\x18\t \x01(\rR\x06height\x12\x1b\n\tlast_sent\x18\n \x01(\x03R\x08lastSent\x12#\n\rlast_received\x18\x0b \x01(\x03R\x0clastReceived\x12\x18\n\x07\x61\x64\x64ress\x18\x0c \x01(\tR\x07\x61\x64\x64ress\x12\x1c\n\tdirection\x18\r \x01(\tR\tdirection\x12\x1c\n\tprotocols\x18\x0e \x03(\tR\tprotocols\x12%\n\x0etotal_sessions\x18\x0f \x01(\x05R\rtotalSessions\x12-\n\x12\x63ompleted_sessions\x18\x10 \x01(\x05R\x11\x63ompletedSessions\x12\x33\n\x0bmetric_info\x18\x11 \x01(\x0b\x32\x12.pactus.MetricInfoR\nmetricInfo\"\x96\x01\n\x0e\x43onnectionInfo\x12 \n\x0b\x63onnections\x18\x01 \x01(\x04R\x0b\x63onnections\x12/\n\x13inbound_connections\x18\x02 \x01(\x04R\x12inboundConnections\x12\x31\n\x14outbound_connections\x18\x03 \x01(\x04R\x13outboundConnections\"\xfb\x03\n\nMetricInfo\x12\x37\n\x0cTotalInvalid\x18\x01 \x01(\x0b\x32\x13.pactus.CounterInfoR\x0cTotalInvalid\x12\x31\n\tTotalSent\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\tTotalSent\x12\x39\n\rTotalReceived\x18\x03 \x01(\x0b\x32\x13.pactus.CounterInfoR\rTotalReceived\x12\x45\n\x0bMessageSent\x18\x04 \x03(\x0b\x32#.pactus.MetricInfo.MessageSentEntryR\x0bMessageSent\x12Q\n\x0fMessageReceived\x18\x05 \x03(\x0b\x32\'.pactus.MetricInfo.MessageReceivedEntryR\x0fMessageReceived\x1aS\n\x10MessageSentEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\x05value:\x02\x38\x01\x1aW\n\x14MessageReceivedEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\x05value:\x02\x38\x01\"=\n\x0b\x43ounterInfo\x12\x14\n\x05\x42ytes\x18\x01 \x01(\x04R\x05\x42ytes\x12\x18\n\x07\x42undles\x18\x02 \x01(\x04R\x07\x42undles2\xa2\x01\n\x07Network\x12O\n\x0eGetNetworkInfo\x12\x1d.pactus.GetNetworkInfoRequest\x1a\x1e.pactus.GetNetworkInfoResponse\x12\x46\n\x0bGetNodeInfo\x12\x1a.pactus.GetNodeInfoRequest\x1a\x1b.pactus.GetNodeInfoResponseBB\n\x0epactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "network_pb2", globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'network_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = ( - b"\n\016pactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactus" - ) - _GETNETWORKINFORESPONSE_SENTBYTESENTRY._options = None - _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_options = b"8\001" - _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._options = None - _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_options = b"8\001" - _PEERINFO_SENTBYTESENTRY._options = None - _PEERINFO_SENTBYTESENTRY._serialized_options = b"8\001" - _PEERINFO_RECEIVEDBYTESENTRY._options = None - _PEERINFO_RECEIVEDBYTESENTRY._serialized_options = b"8\001" - _GETNETWORKINFOREQUEST._serialized_start = 25 - _GETNETWORKINFOREQUEST._serialized_end = 87 - _GETNETWORKINFORESPONSE._serialized_start = 90 - _GETNETWORKINFORESPONSE._serialized_end = 648 - _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_start = 522 - _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_end = 582 - _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_start = 584 - _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_end = 648 - _GETNODEINFOREQUEST._serialized_start = 650 - _GETNODEINFOREQUEST._serialized_end = 670 - _GETNODEINFORESPONSE._serialized_start = 673 - _GETNODEINFORESPONSE._serialized_end = 1064 - _PEERINFO._serialized_start = 1067 - _PEERINFO._serialized_end = 1944 - _PEERINFO_SENTBYTESENTRY._serialized_start = 522 - _PEERINFO_SENTBYTESENTRY._serialized_end = 582 - _PEERINFO_RECEIVEDBYTESENTRY._serialized_start = 584 - _PEERINFO_RECEIVEDBYTESENTRY._serialized_end = 648 - _CONNECTIONINFO._serialized_start = 1947 - _CONNECTIONINFO._serialized_end = 2097 - _NETWORK._serialized_start = 2100 - _NETWORK._serialized_end = 2262 + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\016pactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactus' + _METRICINFO_MESSAGESENTENTRY._options = None + _METRICINFO_MESSAGESENTENTRY._serialized_options = b'8\001' + _METRICINFO_MESSAGERECEIVEDENTRY._options = None + _METRICINFO_MESSAGERECEIVEDENTRY._serialized_options = b'8\001' + _GETNETWORKINFOREQUEST._serialized_start=25 + _GETNETWORKINFOREQUEST._serialized_end=87 + _GETNETWORKINFORESPONSE._serialized_start=90 + _GETNETWORKINFORESPONSE._serialized_end=313 + _GETNODEINFOREQUEST._serialized_start=315 + _GETNODEINFOREQUEST._serialized_end=335 + _GETNODEINFORESPONSE._serialized_start=338 + _GETNODEINFORESPONSE._serialized_end=729 + _PEERINFO._serialized_start=732 + _PEERINFO._serialized_end=1310 + _CONNECTIONINFO._serialized_start=1313 + _CONNECTIONINFO._serialized_end=1463 + _METRICINFO._serialized_start=1466 + _METRICINFO._serialized_end=1973 + _METRICINFO_MESSAGESENTENTRY._serialized_start=1801 + _METRICINFO_MESSAGESENTENTRY._serialized_end=1884 + _METRICINFO_MESSAGERECEIVEDENTRY._serialized_start=1886 + _METRICINFO_MESSAGERECEIVEDENTRY._serialized_end=1973 + _COUNTERINFO._serialized_start=1975 + _COUNTERINFO._serialized_end=2036 + _NETWORK._serialized_start=2039 + _NETWORK._serialized_end=2201 # @@protoc_insertion_point(module_scope) diff --git a/pactus/rpc/network_pb2.pyi b/pactus/rpc/network_pb2.pyi index f55261a..1d199a6 100644 --- a/pactus/rpc/network_pb2.pyi +++ b/pactus/rpc/network_pb2.pyi @@ -1,13 +1,7 @@ from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor @@ -18,78 +12,23 @@ class GetNetworkInfoRequest(_message.Message): def __init__(self, only_connected: bool = ...) -> None: ... class GetNetworkInfoResponse(_message.Message): - __slots__ = ( - "network_name", - "total_sent_bytes", - "total_received_bytes", - "connected_peers_count", - "connected_peers", - "sent_bytes", - "received_bytes", - ) - class SentBytesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: int - value: int - def __init__( - self, key: _Optional[int] = ..., value: _Optional[int] = ... - ) -> None: ... - - class ReceivedBytesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: int - value: int - def __init__( - self, key: _Optional[int] = ..., value: _Optional[int] = ... - ) -> None: ... - + __slots__ = ("network_name", "connected_peers_count", "connected_peers", "metric_info") NETWORK_NAME_FIELD_NUMBER: _ClassVar[int] - TOTAL_SENT_BYTES_FIELD_NUMBER: _ClassVar[int] - TOTAL_RECEIVED_BYTES_FIELD_NUMBER: _ClassVar[int] CONNECTED_PEERS_COUNT_FIELD_NUMBER: _ClassVar[int] CONNECTED_PEERS_FIELD_NUMBER: _ClassVar[int] - SENT_BYTES_FIELD_NUMBER: _ClassVar[int] - RECEIVED_BYTES_FIELD_NUMBER: _ClassVar[int] + METRIC_INFO_FIELD_NUMBER: _ClassVar[int] network_name: str - total_sent_bytes: int - total_received_bytes: int connected_peers_count: int connected_peers: _containers.RepeatedCompositeFieldContainer[PeerInfo] - sent_bytes: _containers.ScalarMap[int, int] - received_bytes: _containers.ScalarMap[int, int] - def __init__( - self, - network_name: _Optional[str] = ..., - total_sent_bytes: _Optional[int] = ..., - total_received_bytes: _Optional[int] = ..., - connected_peers_count: _Optional[int] = ..., - connected_peers: _Optional[_Iterable[_Union[PeerInfo, _Mapping]]] = ..., - sent_bytes: _Optional[_Mapping[int, int]] = ..., - received_bytes: _Optional[_Mapping[int, int]] = ..., - ) -> None: ... + metric_info: MetricInfo + def __init__(self, network_name: _Optional[str] = ..., connected_peers_count: _Optional[int] = ..., connected_peers: _Optional[_Iterable[_Union[PeerInfo, _Mapping]]] = ..., metric_info: _Optional[_Union[MetricInfo, _Mapping]] = ...) -> None: ... class GetNodeInfoRequest(_message.Message): __slots__ = () def __init__(self) -> None: ... class GetNodeInfoResponse(_message.Message): - __slots__ = ( - "moniker", - "agent", - "peer_id", - "started_at", - "reachability", - "services", - "services_names", - "local_addrs", - "protocols", - "clock_offset", - "connection_info", - ) + __slots__ = ("moniker", "agent", "peer_id", "started_at", "reachability", "services", "services_names", "local_addrs", "protocols", "clock_offset", "connection_info") MONIKER_FIELD_NUMBER: _ClassVar[int] AGENT_FIELD_NUMBER: _ClassVar[int] PEER_ID_FIELD_NUMBER: _ClassVar[int] @@ -112,64 +51,10 @@ class GetNodeInfoResponse(_message.Message): protocols: _containers.RepeatedScalarFieldContainer[str] clock_offset: float connection_info: ConnectionInfo - def __init__( - self, - moniker: _Optional[str] = ..., - agent: _Optional[str] = ..., - peer_id: _Optional[str] = ..., - started_at: _Optional[int] = ..., - reachability: _Optional[str] = ..., - services: _Optional[int] = ..., - services_names: _Optional[str] = ..., - local_addrs: _Optional[_Iterable[str]] = ..., - protocols: _Optional[_Iterable[str]] = ..., - clock_offset: _Optional[float] = ..., - connection_info: _Optional[_Union[ConnectionInfo, _Mapping]] = ..., - ) -> None: ... + def __init__(self, moniker: _Optional[str] = ..., agent: _Optional[str] = ..., peer_id: _Optional[str] = ..., started_at: _Optional[int] = ..., reachability: _Optional[str] = ..., services: _Optional[int] = ..., services_names: _Optional[str] = ..., local_addrs: _Optional[_Iterable[str]] = ..., protocols: _Optional[_Iterable[str]] = ..., clock_offset: _Optional[float] = ..., connection_info: _Optional[_Union[ConnectionInfo, _Mapping]] = ...) -> None: ... class PeerInfo(_message.Message): - __slots__ = ( - "status", - "moniker", - "agent", - "peer_id", - "consensus_keys", - "consensus_addresses", - "services", - "last_block_hash", - "height", - "received_bundles", - "invalid_bundles", - "last_sent", - "last_received", - "sent_bytes", - "received_bytes", - "address", - "direction", - "protocols", - "total_sessions", - "completed_sessions", - ) - class SentBytesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: int - value: int - def __init__( - self, key: _Optional[int] = ..., value: _Optional[int] = ... - ) -> None: ... - - class ReceivedBytesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: int - value: int - def __init__( - self, key: _Optional[int] = ..., value: _Optional[int] = ... - ) -> None: ... - + __slots__ = ("status", "moniker", "agent", "peer_id", "consensus_keys", "consensus_addresses", "services", "last_block_hash", "height", "last_sent", "last_received", "address", "direction", "protocols", "total_sessions", "completed_sessions", "metric_info") STATUS_FIELD_NUMBER: _ClassVar[int] MONIKER_FIELD_NUMBER: _ClassVar[int] AGENT_FIELD_NUMBER: _ClassVar[int] @@ -179,17 +64,14 @@ class PeerInfo(_message.Message): SERVICES_FIELD_NUMBER: _ClassVar[int] LAST_BLOCK_HASH_FIELD_NUMBER: _ClassVar[int] HEIGHT_FIELD_NUMBER: _ClassVar[int] - RECEIVED_BUNDLES_FIELD_NUMBER: _ClassVar[int] - INVALID_BUNDLES_FIELD_NUMBER: _ClassVar[int] LAST_SENT_FIELD_NUMBER: _ClassVar[int] LAST_RECEIVED_FIELD_NUMBER: _ClassVar[int] - SENT_BYTES_FIELD_NUMBER: _ClassVar[int] - RECEIVED_BYTES_FIELD_NUMBER: _ClassVar[int] ADDRESS_FIELD_NUMBER: _ClassVar[int] DIRECTION_FIELD_NUMBER: _ClassVar[int] PROTOCOLS_FIELD_NUMBER: _ClassVar[int] TOTAL_SESSIONS_FIELD_NUMBER: _ClassVar[int] COMPLETED_SESSIONS_FIELD_NUMBER: _ClassVar[int] + METRIC_INFO_FIELD_NUMBER: _ClassVar[int] status: int moniker: str agent: str @@ -199,40 +81,15 @@ class PeerInfo(_message.Message): services: int last_block_hash: str height: int - received_bundles: int - invalid_bundles: int last_sent: int last_received: int - sent_bytes: _containers.ScalarMap[int, int] - received_bytes: _containers.ScalarMap[int, int] address: str direction: str protocols: _containers.RepeatedScalarFieldContainer[str] total_sessions: int completed_sessions: int - def __init__( - self, - status: _Optional[int] = ..., - moniker: _Optional[str] = ..., - agent: _Optional[str] = ..., - peer_id: _Optional[str] = ..., - consensus_keys: _Optional[_Iterable[str]] = ..., - consensus_addresses: _Optional[_Iterable[str]] = ..., - services: _Optional[int] = ..., - last_block_hash: _Optional[str] = ..., - height: _Optional[int] = ..., - received_bundles: _Optional[int] = ..., - invalid_bundles: _Optional[int] = ..., - last_sent: _Optional[int] = ..., - last_received: _Optional[int] = ..., - sent_bytes: _Optional[_Mapping[int, int]] = ..., - received_bytes: _Optional[_Mapping[int, int]] = ..., - address: _Optional[str] = ..., - direction: _Optional[str] = ..., - protocols: _Optional[_Iterable[str]] = ..., - total_sessions: _Optional[int] = ..., - completed_sessions: _Optional[int] = ..., - ) -> None: ... + metric_info: MetricInfo + def __init__(self, status: _Optional[int] = ..., moniker: _Optional[str] = ..., agent: _Optional[str] = ..., peer_id: _Optional[str] = ..., consensus_keys: _Optional[_Iterable[str]] = ..., consensus_addresses: _Optional[_Iterable[str]] = ..., services: _Optional[int] = ..., last_block_hash: _Optional[str] = ..., height: _Optional[int] = ..., last_sent: _Optional[int] = ..., last_received: _Optional[int] = ..., address: _Optional[str] = ..., direction: _Optional[str] = ..., protocols: _Optional[_Iterable[str]] = ..., total_sessions: _Optional[int] = ..., completed_sessions: _Optional[int] = ..., metric_info: _Optional[_Union[MetricInfo, _Mapping]] = ...) -> None: ... class ConnectionInfo(_message.Message): __slots__ = ("connections", "inbound_connections", "outbound_connections") @@ -242,9 +99,40 @@ class ConnectionInfo(_message.Message): connections: int inbound_connections: int outbound_connections: int - def __init__( - self, - connections: _Optional[int] = ..., - inbound_connections: _Optional[int] = ..., - outbound_connections: _Optional[int] = ..., - ) -> None: ... + def __init__(self, connections: _Optional[int] = ..., inbound_connections: _Optional[int] = ..., outbound_connections: _Optional[int] = ...) -> None: ... + +class MetricInfo(_message.Message): + __slots__ = ("TotalInvalid", "TotalSent", "TotalReceived", "MessageSent", "MessageReceived") + class MessageSentEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: int + value: CounterInfo + def __init__(self, key: _Optional[int] = ..., value: _Optional[_Union[CounterInfo, _Mapping]] = ...) -> None: ... + class MessageReceivedEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: int + value: CounterInfo + def __init__(self, key: _Optional[int] = ..., value: _Optional[_Union[CounterInfo, _Mapping]] = ...) -> None: ... + TOTALINVALID_FIELD_NUMBER: _ClassVar[int] + TOTALSENT_FIELD_NUMBER: _ClassVar[int] + TOTALRECEIVED_FIELD_NUMBER: _ClassVar[int] + MESSAGESENT_FIELD_NUMBER: _ClassVar[int] + MESSAGERECEIVED_FIELD_NUMBER: _ClassVar[int] + TotalInvalid: CounterInfo + TotalSent: CounterInfo + TotalReceived: CounterInfo + MessageSent: _containers.MessageMap[int, CounterInfo] + MessageReceived: _containers.MessageMap[int, CounterInfo] + def __init__(self, TotalInvalid: _Optional[_Union[CounterInfo, _Mapping]] = ..., TotalSent: _Optional[_Union[CounterInfo, _Mapping]] = ..., TotalReceived: _Optional[_Union[CounterInfo, _Mapping]] = ..., MessageSent: _Optional[_Mapping[int, CounterInfo]] = ..., MessageReceived: _Optional[_Mapping[int, CounterInfo]] = ...) -> None: ... + +class CounterInfo(_message.Message): + __slots__ = ("Bytes", "Bundles") + BYTES_FIELD_NUMBER: _ClassVar[int] + BUNDLES_FIELD_NUMBER: _ClassVar[int] + Bytes: int + Bundles: int + def __init__(self, Bytes: _Optional[int] = ..., Bundles: _Optional[int] = ...) -> None: ... diff --git a/pactus/rpc/network_pb2_grpc.py b/pactus/rpc/network_pb2_grpc.py index b7e3789..d9153e6 100644 --- a/pactus/rpc/network_pb2_grpc.py +++ b/pactus/rpc/network_pb2_grpc.py @@ -1,13 +1,13 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" - import grpc from . import network_pb2 as network__pb2 class NetworkStub(object): - """Network service provides RPCs for retrieving information about the network.""" + """Network service provides RPCs for retrieving information about the network. + """ def __init__(self, channel): """Constructor. @@ -16,110 +16,89 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.GetNetworkInfo = channel.unary_unary( - "/pactus.Network/GetNetworkInfo", - request_serializer=network__pb2.GetNetworkInfoRequest.SerializeToString, - response_deserializer=network__pb2.GetNetworkInfoResponse.FromString, - ) + '/pactus.Network/GetNetworkInfo', + request_serializer=network__pb2.GetNetworkInfoRequest.SerializeToString, + response_deserializer=network__pb2.GetNetworkInfoResponse.FromString, + ) self.GetNodeInfo = channel.unary_unary( - "/pactus.Network/GetNodeInfo", - request_serializer=network__pb2.GetNodeInfoRequest.SerializeToString, - response_deserializer=network__pb2.GetNodeInfoResponse.FromString, - ) + '/pactus.Network/GetNodeInfo', + request_serializer=network__pb2.GetNodeInfoRequest.SerializeToString, + response_deserializer=network__pb2.GetNodeInfoResponse.FromString, + ) class NetworkServicer(object): - """Network service provides RPCs for retrieving information about the network.""" + """Network service provides RPCs for retrieving information about the network. + """ def GetNetworkInfo(self, request, context): - """GetNetworkInfo retrieves information about the overall network.""" + """GetNetworkInfo retrieves information about the overall network. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetNodeInfo(self, request, context): - """GetNodeInfo retrieves information about a specific node in the network.""" + """GetNodeInfo retrieves information about a specific node in the network. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_NetworkServicer_to_server(servicer, server): rpc_method_handlers = { - "GetNetworkInfo": grpc.unary_unary_rpc_method_handler( - servicer.GetNetworkInfo, - request_deserializer=network__pb2.GetNetworkInfoRequest.FromString, - response_serializer=network__pb2.GetNetworkInfoResponse.SerializeToString, - ), - "GetNodeInfo": grpc.unary_unary_rpc_method_handler( - servicer.GetNodeInfo, - request_deserializer=network__pb2.GetNodeInfoRequest.FromString, - response_serializer=network__pb2.GetNodeInfoResponse.SerializeToString, - ), + 'GetNetworkInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetNetworkInfo, + request_deserializer=network__pb2.GetNetworkInfoRequest.FromString, + response_serializer=network__pb2.GetNetworkInfoResponse.SerializeToString, + ), + 'GetNodeInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetNodeInfo, + request_deserializer=network__pb2.GetNodeInfoRequest.FromString, + response_serializer=network__pb2.GetNodeInfoResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - "pactus.Network", rpc_method_handlers - ) + 'pactus.Network', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) -# This class is part of an EXPERIMENTAL API. + # This class is part of an EXPERIMENTAL API. class Network(object): - """Network service provides RPCs for retrieving information about the network.""" + """Network service provides RPCs for retrieving information about the network. + """ @staticmethod - def GetNetworkInfo( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetNetworkInfo(request, target, - "/pactus.Network/GetNetworkInfo", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Network/GetNetworkInfo', network__pb2.GetNetworkInfoRequest.SerializeToString, network__pb2.GetNetworkInfoResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetNodeInfo( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetNodeInfo(request, target, - "/pactus.Network/GetNodeInfo", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Network/GetNodeInfo', network__pb2.GetNodeInfoRequest.SerializeToString, network__pb2.GetNodeInfoResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pactus/rpc/ruff.toml b/pactus/rpc/ruff.toml index 1488a3e..f639114 100644 --- a/pactus/rpc/ruff.toml +++ b/pactus/rpc/ruff.toml @@ -1,2 +1,5 @@ [lint] ignore = ["ALL"] + +[format] +exclude = ["*"] diff --git a/pactus/rpc/transaction_pb2.py b/pactus/rpc/transaction_pb2.py index 6b81100..ec6a901 100644 --- a/pactus/rpc/transaction_pb2.py +++ b/pactus/rpc/transaction_pb2.py @@ -2,7 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: transaction.proto """Generated protocol buffer code.""" - from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,55 +11,54 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x11transaction.proto\x12\x06pactus"c\n\x15GetTransactionRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12:\n\tverbosity\x18\x02 \x01(\x0e\x32\x1c.pactus.TransactionVerbosityR\tverbosity"\x95\x01\n\x16GetTransactionResponse\x12!\n\x0c\x62lock_height\x18\x01 \x01(\rR\x0b\x62lockHeight\x12\x1d\n\nblock_time\x18\x02 \x01(\rR\tblockTime\x12\x39\n\x0btransaction\x18\x03 \x01(\x0b\x32\x17.pactus.TransactionInfoR\x0btransaction"\x88\x01\n\x13\x43\x61lculateFeeRequest\x12\x16\n\x06\x61mount\x18\x01 \x01(\x03R\x06\x61mount\x12\x36\n\x0cpayload_type\x18\x02 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bpayloadType\x12!\n\x0c\x66ixed_amount\x18\x03 \x01(\x08R\x0b\x66ixedAmount"@\n\x14\x43\x61lculateFeeResponse\x12\x16\n\x06\x61mount\x18\x01 \x01(\x03R\x06\x61mount\x12\x10\n\x03\x66\x65\x65\x18\x02 \x01(\x03R\x03\x66\x65\x65"S\n\x1b\x42roadcastTransactionRequest\x12\x34\n\x16signed_raw_transaction\x18\x01 \x01(\tR\x14signedRawTransaction".\n\x1c\x42roadcastTransactionResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id"\xb1\x01\n GetRawTransferTransactionRequest\x12\x1b\n\tlock_time\x18\x01 \x01(\rR\x08lockTime\x12\x16\n\x06sender\x18\x02 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x03 \x01(\tR\x08receiver\x12\x16\n\x06\x61mount\x18\x04 \x01(\x03R\x06\x61mount\x12\x10\n\x03\x66\x65\x65\x18\x05 \x01(\x03R\x03\x66\x65\x65\x12\x12\n\x04memo\x18\x06 \x01(\tR\x04memo"\xca\x01\n\x1cGetRawBondTransactionRequest\x12\x1b\n\tlock_time\x18\x01 \x01(\rR\x08lockTime\x12\x16\n\x06sender\x18\x02 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x03 \x01(\tR\x08receiver\x12\x14\n\x05stake\x18\x04 \x01(\x03R\x05stake\x12\x1d\n\npublic_key\x18\x05 \x01(\tR\tpublicKey\x12\x10\n\x03\x66\x65\x65\x18\x06 \x01(\x03R\x03\x66\x65\x65\x12\x12\n\x04memo\x18\x07 \x01(\tR\x04memo"~\n\x1eGetRawUnbondTransactionRequest\x12\x1b\n\tlock_time\x18\x01 \x01(\rR\x08lockTime\x12+\n\x11validator_address\x18\x03 \x01(\tR\x10validatorAddress\x12\x12\n\x04memo\x18\x04 \x01(\tR\x04memo"\xd3\x01\n GetRawWithdrawTransactionRequest\x12\x1b\n\tlock_time\x18\x01 \x01(\rR\x08lockTime\x12+\n\x11validator_address\x18\x02 \x01(\tR\x10validatorAddress\x12\'\n\x0f\x61\x63\x63ount_address\x18\x03 \x01(\tR\x0e\x61\x63\x63ountAddress\x12\x16\n\x06\x61mount\x18\x04 \x01(\x03R\x06\x61mount\x12\x10\n\x03\x66\x65\x65\x18\x05 \x01(\x03R\x03\x66\x65\x65\x12\x12\n\x04memo\x18\x06 \x01(\tR\x04memo"D\n\x19GetRawTransactionResponse\x12\'\n\x0fraw_transaction\x18\x01 \x01(\tR\x0erawTransaction"]\n\x0fPayloadTransfer\x12\x16\n\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x02 \x01(\tR\x08receiver\x12\x16\n\x06\x61mount\x18\x03 \x01(\x03R\x06\x61mount"W\n\x0bPayloadBond\x12\x16\n\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x02 \x01(\tR\x08receiver\x12\x14\n\x05stake\x18\x03 \x01(\x03R\x05stake"B\n\x10PayloadSortition\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x14\n\x05proof\x18\x02 \x01(\tR\x05proof"-\n\rPayloadUnbond\x12\x1c\n\tvalidator\x18\x01 \x01(\tR\tvalidator"M\n\x0fPayloadWithdraw\x12\x12\n\x04\x66rom\x18\x01 \x01(\tR\x04\x66rom\x12\x0e\n\x02to\x18\x02 \x01(\tR\x02to\x12\x16\n\x06\x61mount\x18\x03 \x01(\x03R\x06\x61mount"\xac\x04\n\x0fTransactionInfo\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\tR\x04\x64\x61ta\x12\x18\n\x07version\x18\x03 \x01(\x05R\x07version\x12\x1b\n\tlock_time\x18\x04 \x01(\rR\x08lockTime\x12\x14\n\x05value\x18\x05 \x01(\x03R\x05value\x12\x10\n\x03\x66\x65\x65\x18\x06 \x01(\x03R\x03\x66\x65\x65\x12\x36\n\x0cpayload_type\x18\x07 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bpayloadType\x12\x35\n\x08transfer\x18\x1e \x01(\x0b\x32\x17.pactus.PayloadTransferH\x00R\x08transfer\x12)\n\x04\x62ond\x18\x1f \x01(\x0b\x32\x13.pactus.PayloadBondH\x00R\x04\x62ond\x12\x38\n\tsortition\x18 \x01(\x0b\x32\x18.pactus.PayloadSortitionH\x00R\tsortition\x12/\n\x06unbond\x18! \x01(\x0b\x32\x15.pactus.PayloadUnbondH\x00R\x06unbond\x12\x35\n\x08withdraw\x18" \x01(\x0b\x32\x17.pactus.PayloadWithdrawH\x00R\x08withdraw\x12\x12\n\x04memo\x18\x08 \x01(\tR\x04memo\x12\x1d\n\npublic_key\x18\t \x01(\tR\tpublicKey\x12\x1c\n\tsignature\x18\n \x01(\tR\tsignatureB\t\n\x07payload*\x83\x01\n\x0bPayloadType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x14\n\x10TRANSFER_PAYLOAD\x10\x01\x12\x10\n\x0c\x42OND_PAYLOAD\x10\x02\x12\x15\n\x11SORTITION_PAYLOAD\x10\x03\x12\x12\n\x0eUNBOND_PAYLOAD\x10\x04\x12\x14\n\x10WITHDRAW_PAYLOAD\x10\x05*B\n\x14TransactionVerbosity\x12\x14\n\x10TRANSACTION_DATA\x10\x00\x12\x14\n\x10TRANSACTION_INFO\x10\x01\x32\xa8\x05\n\x0bTransaction\x12O\n\x0eGetTransaction\x12\x1d.pactus.GetTransactionRequest\x1a\x1e.pactus.GetTransactionResponse\x12I\n\x0c\x43\x61lculateFee\x12\x1b.pactus.CalculateFeeRequest\x1a\x1c.pactus.CalculateFeeResponse\x12\x61\n\x14\x42roadcastTransaction\x12#.pactus.BroadcastTransactionRequest\x1a$.pactus.BroadcastTransactionResponse\x12h\n\x19GetRawTransferTransaction\x12(.pactus.GetRawTransferTransactionRequest\x1a!.pactus.GetRawTransactionResponse\x12`\n\x15GetRawBondTransaction\x12$.pactus.GetRawBondTransactionRequest\x1a!.pactus.GetRawTransactionResponse\x12\x64\n\x17GetRawUnbondTransaction\x12&.pactus.GetRawUnbondTransactionRequest\x1a!.pactus.GetRawTransactionResponse\x12h\n\x19GetRawWithdrawTransaction\x12(.pactus.GetRawWithdrawTransactionRequest\x1a!.pactus.GetRawTransactionResponseBF\n\x12pactus.transactionZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3' -) + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11transaction.proto\x12\x06pactus\"c\n\x15GetTransactionRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12:\n\tverbosity\x18\x02 \x01(\x0e\x32\x1c.pactus.TransactionVerbosityR\tverbosity\"\x95\x01\n\x16GetTransactionResponse\x12!\n\x0c\x62lock_height\x18\x01 \x01(\rR\x0b\x62lockHeight\x12\x1d\n\nblock_time\x18\x02 \x01(\rR\tblockTime\x12\x39\n\x0btransaction\x18\x03 \x01(\x0b\x32\x17.pactus.TransactionInfoR\x0btransaction\"\x88\x01\n\x13\x43\x61lculateFeeRequest\x12\x16\n\x06\x61mount\x18\x01 \x01(\x03R\x06\x61mount\x12\x36\n\x0cpayload_type\x18\x02 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bpayloadType\x12!\n\x0c\x66ixed_amount\x18\x03 \x01(\x08R\x0b\x66ixedAmount\"@\n\x14\x43\x61lculateFeeResponse\x12\x16\n\x06\x61mount\x18\x01 \x01(\x03R\x06\x61mount\x12\x10\n\x03\x66\x65\x65\x18\x02 \x01(\x03R\x03\x66\x65\x65\"S\n\x1b\x42roadcastTransactionRequest\x12\x34\n\x16signed_raw_transaction\x18\x01 \x01(\tR\x14signedRawTransaction\".\n\x1c\x42roadcastTransactionResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\"\xb1\x01\n GetRawTransferTransactionRequest\x12\x1b\n\tlock_time\x18\x01 \x01(\rR\x08lockTime\x12\x16\n\x06sender\x18\x02 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x03 \x01(\tR\x08receiver\x12\x16\n\x06\x61mount\x18\x04 \x01(\x03R\x06\x61mount\x12\x10\n\x03\x66\x65\x65\x18\x05 \x01(\x03R\x03\x66\x65\x65\x12\x12\n\x04memo\x18\x06 \x01(\tR\x04memo\"\xca\x01\n\x1cGetRawBondTransactionRequest\x12\x1b\n\tlock_time\x18\x01 \x01(\rR\x08lockTime\x12\x16\n\x06sender\x18\x02 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x03 \x01(\tR\x08receiver\x12\x14\n\x05stake\x18\x04 \x01(\x03R\x05stake\x12\x1d\n\npublic_key\x18\x05 \x01(\tR\tpublicKey\x12\x10\n\x03\x66\x65\x65\x18\x06 \x01(\x03R\x03\x66\x65\x65\x12\x12\n\x04memo\x18\x07 \x01(\tR\x04memo\"~\n\x1eGetRawUnbondTransactionRequest\x12\x1b\n\tlock_time\x18\x01 \x01(\rR\x08lockTime\x12+\n\x11validator_address\x18\x03 \x01(\tR\x10validatorAddress\x12\x12\n\x04memo\x18\x04 \x01(\tR\x04memo\"\xd3\x01\n GetRawWithdrawTransactionRequest\x12\x1b\n\tlock_time\x18\x01 \x01(\rR\x08lockTime\x12+\n\x11validator_address\x18\x02 \x01(\tR\x10validatorAddress\x12\'\n\x0f\x61\x63\x63ount_address\x18\x03 \x01(\tR\x0e\x61\x63\x63ountAddress\x12\x16\n\x06\x61mount\x18\x04 \x01(\x03R\x06\x61mount\x12\x10\n\x03\x66\x65\x65\x18\x05 \x01(\x03R\x03\x66\x65\x65\x12\x12\n\x04memo\x18\x06 \x01(\tR\x04memo\"T\n\x19GetRawTransactionResponse\x12\'\n\x0fraw_transaction\x18\x01 \x01(\tR\x0erawTransaction\x12\x0e\n\x02id\x18\x02 \x01(\tR\x02id\"]\n\x0fPayloadTransfer\x12\x16\n\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x02 \x01(\tR\x08receiver\x12\x16\n\x06\x61mount\x18\x03 \x01(\x03R\x06\x61mount\"v\n\x0bPayloadBond\x12\x16\n\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x02 \x01(\tR\x08receiver\x12\x14\n\x05stake\x18\x03 \x01(\x03R\x05stake\x12\x1d\n\npublic_key\x18\x04 \x01(\tR\tpublicKey\"B\n\x10PayloadSortition\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x14\n\x05proof\x18\x02 \x01(\tR\x05proof\"-\n\rPayloadUnbond\x12\x1c\n\tvalidator\x18\x01 \x01(\tR\tvalidator\"\x7f\n\x0fPayloadWithdraw\x12+\n\x11validator_address\x18\x01 \x01(\tR\x10validatorAddress\x12\'\n\x0f\x61\x63\x63ount_address\x18\x02 \x01(\tR\x0e\x61\x63\x63ountAddress\x12\x16\n\x06\x61mount\x18\x03 \x01(\x03R\x06\x61mount\"\xac\x04\n\x0fTransactionInfo\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\tR\x04\x64\x61ta\x12\x18\n\x07version\x18\x03 \x01(\x05R\x07version\x12\x1b\n\tlock_time\x18\x04 \x01(\rR\x08lockTime\x12\x14\n\x05value\x18\x05 \x01(\x03R\x05value\x12\x10\n\x03\x66\x65\x65\x18\x06 \x01(\x03R\x03\x66\x65\x65\x12\x36\n\x0cpayload_type\x18\x07 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bpayloadType\x12\x35\n\x08transfer\x18\x1e \x01(\x0b\x32\x17.pactus.PayloadTransferH\x00R\x08transfer\x12)\n\x04\x62ond\x18\x1f \x01(\x0b\x32\x13.pactus.PayloadBondH\x00R\x04\x62ond\x12\x38\n\tsortition\x18 \x01(\x0b\x32\x18.pactus.PayloadSortitionH\x00R\tsortition\x12/\n\x06unbond\x18! \x01(\x0b\x32\x15.pactus.PayloadUnbondH\x00R\x06unbond\x12\x35\n\x08withdraw\x18\" \x01(\x0b\x32\x17.pactus.PayloadWithdrawH\x00R\x08withdraw\x12\x12\n\x04memo\x18\x08 \x01(\tR\x04memo\x12\x1d\n\npublic_key\x18\t \x01(\tR\tpublicKey\x12\x1c\n\tsignature\x18\n \x01(\tR\tsignatureB\t\n\x07payload*\x83\x01\n\x0bPayloadType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x14\n\x10TRANSFER_PAYLOAD\x10\x01\x12\x10\n\x0c\x42OND_PAYLOAD\x10\x02\x12\x15\n\x11SORTITION_PAYLOAD\x10\x03\x12\x12\n\x0eUNBOND_PAYLOAD\x10\x04\x12\x14\n\x10WITHDRAW_PAYLOAD\x10\x05*B\n\x14TransactionVerbosity\x12\x14\n\x10TRANSACTION_DATA\x10\x00\x12\x14\n\x10TRANSACTION_INFO\x10\x01\x32\xa8\x05\n\x0bTransaction\x12O\n\x0eGetTransaction\x12\x1d.pactus.GetTransactionRequest\x1a\x1e.pactus.GetTransactionResponse\x12I\n\x0c\x43\x61lculateFee\x12\x1b.pactus.CalculateFeeRequest\x1a\x1c.pactus.CalculateFeeResponse\x12\x61\n\x14\x42roadcastTransaction\x12#.pactus.BroadcastTransactionRequest\x1a$.pactus.BroadcastTransactionResponse\x12h\n\x19GetRawTransferTransaction\x12(.pactus.GetRawTransferTransactionRequest\x1a!.pactus.GetRawTransactionResponse\x12`\n\x15GetRawBondTransaction\x12$.pactus.GetRawBondTransactionRequest\x1a!.pactus.GetRawTransactionResponse\x12\x64\n\x17GetRawUnbondTransaction\x12&.pactus.GetRawUnbondTransactionRequest\x1a!.pactus.GetRawTransactionResponse\x12h\n\x19GetRawWithdrawTransaction\x12(.pactus.GetRawWithdrawTransactionRequest\x1a!.pactus.GetRawTransactionResponseBF\n\x12pactus.transactionZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "transaction_pb2", globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'transaction_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = ( - b"\n\022pactus.transactionZ0github.com/pactus-project/pactus/www/grpc/pactus" - ) - _PAYLOADTYPE._serialized_start = 2355 - _PAYLOADTYPE._serialized_end = 2486 - _TRANSACTIONVERBOSITY._serialized_start = 2488 - _TRANSACTIONVERBOSITY._serialized_end = 2554 - _GETTRANSACTIONREQUEST._serialized_start = 29 - _GETTRANSACTIONREQUEST._serialized_end = 128 - _GETTRANSACTIONRESPONSE._serialized_start = 131 - _GETTRANSACTIONRESPONSE._serialized_end = 280 - _CALCULATEFEEREQUEST._serialized_start = 283 - _CALCULATEFEEREQUEST._serialized_end = 419 - _CALCULATEFEERESPONSE._serialized_start = 421 - _CALCULATEFEERESPONSE._serialized_end = 485 - _BROADCASTTRANSACTIONREQUEST._serialized_start = 487 - _BROADCASTTRANSACTIONREQUEST._serialized_end = 570 - _BROADCASTTRANSACTIONRESPONSE._serialized_start = 572 - _BROADCASTTRANSACTIONRESPONSE._serialized_end = 618 - _GETRAWTRANSFERTRANSACTIONREQUEST._serialized_start = 621 - _GETRAWTRANSFERTRANSACTIONREQUEST._serialized_end = 798 - _GETRAWBONDTRANSACTIONREQUEST._serialized_start = 801 - _GETRAWBONDTRANSACTIONREQUEST._serialized_end = 1003 - _GETRAWUNBONDTRANSACTIONREQUEST._serialized_start = 1005 - _GETRAWUNBONDTRANSACTIONREQUEST._serialized_end = 1131 - _GETRAWWITHDRAWTRANSACTIONREQUEST._serialized_start = 1134 - _GETRAWWITHDRAWTRANSACTIONREQUEST._serialized_end = 1345 - _GETRAWTRANSACTIONRESPONSE._serialized_start = 1347 - _GETRAWTRANSACTIONRESPONSE._serialized_end = 1415 - _PAYLOADTRANSFER._serialized_start = 1417 - _PAYLOADTRANSFER._serialized_end = 1510 - _PAYLOADBOND._serialized_start = 1512 - _PAYLOADBOND._serialized_end = 1599 - _PAYLOADSORTITION._serialized_start = 1601 - _PAYLOADSORTITION._serialized_end = 1667 - _PAYLOADUNBOND._serialized_start = 1669 - _PAYLOADUNBOND._serialized_end = 1714 - _PAYLOADWITHDRAW._serialized_start = 1716 - _PAYLOADWITHDRAW._serialized_end = 1793 - _TRANSACTIONINFO._serialized_start = 1796 - _TRANSACTIONINFO._serialized_end = 2352 - _TRANSACTION._serialized_start = 2557 - _TRANSACTION._serialized_end = 3237 + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\022pactus.transactionZ0github.com/pactus-project/pactus/www/grpc/pactus' + _PAYLOADTYPE._serialized_start=2452 + _PAYLOADTYPE._serialized_end=2583 + _TRANSACTIONVERBOSITY._serialized_start=2585 + _TRANSACTIONVERBOSITY._serialized_end=2651 + _GETTRANSACTIONREQUEST._serialized_start=29 + _GETTRANSACTIONREQUEST._serialized_end=128 + _GETTRANSACTIONRESPONSE._serialized_start=131 + _GETTRANSACTIONRESPONSE._serialized_end=280 + _CALCULATEFEEREQUEST._serialized_start=283 + _CALCULATEFEEREQUEST._serialized_end=419 + _CALCULATEFEERESPONSE._serialized_start=421 + _CALCULATEFEERESPONSE._serialized_end=485 + _BROADCASTTRANSACTIONREQUEST._serialized_start=487 + _BROADCASTTRANSACTIONREQUEST._serialized_end=570 + _BROADCASTTRANSACTIONRESPONSE._serialized_start=572 + _BROADCASTTRANSACTIONRESPONSE._serialized_end=618 + _GETRAWTRANSFERTRANSACTIONREQUEST._serialized_start=621 + _GETRAWTRANSFERTRANSACTIONREQUEST._serialized_end=798 + _GETRAWBONDTRANSACTIONREQUEST._serialized_start=801 + _GETRAWBONDTRANSACTIONREQUEST._serialized_end=1003 + _GETRAWUNBONDTRANSACTIONREQUEST._serialized_start=1005 + _GETRAWUNBONDTRANSACTIONREQUEST._serialized_end=1131 + _GETRAWWITHDRAWTRANSACTIONREQUEST._serialized_start=1134 + _GETRAWWITHDRAWTRANSACTIONREQUEST._serialized_end=1345 + _GETRAWTRANSACTIONRESPONSE._serialized_start=1347 + _GETRAWTRANSACTIONRESPONSE._serialized_end=1431 + _PAYLOADTRANSFER._serialized_start=1433 + _PAYLOADTRANSFER._serialized_end=1526 + _PAYLOADBOND._serialized_start=1528 + _PAYLOADBOND._serialized_end=1646 + _PAYLOADSORTITION._serialized_start=1648 + _PAYLOADSORTITION._serialized_end=1714 + _PAYLOADUNBOND._serialized_start=1716 + _PAYLOADUNBOND._serialized_end=1761 + _PAYLOADWITHDRAW._serialized_start=1763 + _PAYLOADWITHDRAW._serialized_end=1890 + _TRANSACTIONINFO._serialized_start=1893 + _TRANSACTIONINFO._serialized_end=2449 + _TRANSACTION._serialized_start=2654 + _TRANSACTION._serialized_end=3334 # @@protoc_insertion_point(module_scope) diff --git a/pactus/rpc/transaction_pb2.pyi b/pactus/rpc/transaction_pb2.pyi index 653b7ae..45e6fc4 100644 --- a/pactus/rpc/transaction_pb2.pyi +++ b/pactus/rpc/transaction_pb2.pyi @@ -1,12 +1,7 @@ from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) +from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor @@ -23,7 +18,6 @@ class TransactionVerbosity(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () TRANSACTION_DATA: _ClassVar[TransactionVerbosity] TRANSACTION_INFO: _ClassVar[TransactionVerbosity] - UNKNOWN: PayloadType TRANSFER_PAYLOAD: PayloadType BOND_PAYLOAD: PayloadType @@ -39,11 +33,7 @@ class GetTransactionRequest(_message.Message): VERBOSITY_FIELD_NUMBER: _ClassVar[int] id: str verbosity: TransactionVerbosity - def __init__( - self, - id: _Optional[str] = ..., - verbosity: _Optional[_Union[TransactionVerbosity, str]] = ..., - ) -> None: ... + def __init__(self, id: _Optional[str] = ..., verbosity: _Optional[_Union[TransactionVerbosity, str]] = ...) -> None: ... class GetTransactionResponse(_message.Message): __slots__ = ("block_height", "block_time", "transaction") @@ -53,12 +43,7 @@ class GetTransactionResponse(_message.Message): block_height: int block_time: int transaction: TransactionInfo - def __init__( - self, - block_height: _Optional[int] = ..., - block_time: _Optional[int] = ..., - transaction: _Optional[_Union[TransactionInfo, _Mapping]] = ..., - ) -> None: ... + def __init__(self, block_height: _Optional[int] = ..., block_time: _Optional[int] = ..., transaction: _Optional[_Union[TransactionInfo, _Mapping]] = ...) -> None: ... class CalculateFeeRequest(_message.Message): __slots__ = ("amount", "payload_type", "fixed_amount") @@ -68,12 +53,7 @@ class CalculateFeeRequest(_message.Message): amount: int payload_type: PayloadType fixed_amount: bool - def __init__( - self, - amount: _Optional[int] = ..., - payload_type: _Optional[_Union[PayloadType, str]] = ..., - fixed_amount: bool = ..., - ) -> None: ... + def __init__(self, amount: _Optional[int] = ..., payload_type: _Optional[_Union[PayloadType, str]] = ..., fixed_amount: bool = ...) -> None: ... class CalculateFeeResponse(_message.Message): __slots__ = ("amount", "fee") @@ -81,9 +61,7 @@ class CalculateFeeResponse(_message.Message): FEE_FIELD_NUMBER: _ClassVar[int] amount: int fee: int - def __init__( - self, amount: _Optional[int] = ..., fee: _Optional[int] = ... - ) -> None: ... + def __init__(self, amount: _Optional[int] = ..., fee: _Optional[int] = ...) -> None: ... class BroadcastTransactionRequest(_message.Message): __slots__ = ("signed_raw_transaction",) @@ -111,26 +89,10 @@ class GetRawTransferTransactionRequest(_message.Message): amount: int fee: int memo: str - def __init__( - self, - lock_time: _Optional[int] = ..., - sender: _Optional[str] = ..., - receiver: _Optional[str] = ..., - amount: _Optional[int] = ..., - fee: _Optional[int] = ..., - memo: _Optional[str] = ..., - ) -> None: ... + def __init__(self, lock_time: _Optional[int] = ..., sender: _Optional[str] = ..., receiver: _Optional[str] = ..., amount: _Optional[int] = ..., fee: _Optional[int] = ..., memo: _Optional[str] = ...) -> None: ... class GetRawBondTransactionRequest(_message.Message): - __slots__ = ( - "lock_time", - "sender", - "receiver", - "stake", - "public_key", - "fee", - "memo", - ) + __slots__ = ("lock_time", "sender", "receiver", "stake", "public_key", "fee", "memo") LOCK_TIME_FIELD_NUMBER: _ClassVar[int] SENDER_FIELD_NUMBER: _ClassVar[int] RECEIVER_FIELD_NUMBER: _ClassVar[int] @@ -145,16 +107,7 @@ class GetRawBondTransactionRequest(_message.Message): public_key: str fee: int memo: str - def __init__( - self, - lock_time: _Optional[int] = ..., - sender: _Optional[str] = ..., - receiver: _Optional[str] = ..., - stake: _Optional[int] = ..., - public_key: _Optional[str] = ..., - fee: _Optional[int] = ..., - memo: _Optional[str] = ..., - ) -> None: ... + def __init__(self, lock_time: _Optional[int] = ..., sender: _Optional[str] = ..., receiver: _Optional[str] = ..., stake: _Optional[int] = ..., public_key: _Optional[str] = ..., fee: _Optional[int] = ..., memo: _Optional[str] = ...) -> None: ... class GetRawUnbondTransactionRequest(_message.Message): __slots__ = ("lock_time", "validator_address", "memo") @@ -164,22 +117,10 @@ class GetRawUnbondTransactionRequest(_message.Message): lock_time: int validator_address: str memo: str - def __init__( - self, - lock_time: _Optional[int] = ..., - validator_address: _Optional[str] = ..., - memo: _Optional[str] = ..., - ) -> None: ... + def __init__(self, lock_time: _Optional[int] = ..., validator_address: _Optional[str] = ..., memo: _Optional[str] = ...) -> None: ... class GetRawWithdrawTransactionRequest(_message.Message): - __slots__ = ( - "lock_time", - "validator_address", - "account_address", - "amount", - "fee", - "memo", - ) + __slots__ = ("lock_time", "validator_address", "account_address", "amount", "fee", "memo") LOCK_TIME_FIELD_NUMBER: _ClassVar[int] VALIDATOR_ADDRESS_FIELD_NUMBER: _ClassVar[int] ACCOUNT_ADDRESS_FIELD_NUMBER: _ClassVar[int] @@ -192,21 +133,15 @@ class GetRawWithdrawTransactionRequest(_message.Message): amount: int fee: int memo: str - def __init__( - self, - lock_time: _Optional[int] = ..., - validator_address: _Optional[str] = ..., - account_address: _Optional[str] = ..., - amount: _Optional[int] = ..., - fee: _Optional[int] = ..., - memo: _Optional[str] = ..., - ) -> None: ... + def __init__(self, lock_time: _Optional[int] = ..., validator_address: _Optional[str] = ..., account_address: _Optional[str] = ..., amount: _Optional[int] = ..., fee: _Optional[int] = ..., memo: _Optional[str] = ...) -> None: ... class GetRawTransactionResponse(_message.Message): - __slots__ = ("raw_transaction",) + __slots__ = ("raw_transaction", "id") RAW_TRANSACTION_FIELD_NUMBER: _ClassVar[int] + ID_FIELD_NUMBER: _ClassVar[int] raw_transaction: str - def __init__(self, raw_transaction: _Optional[str] = ...) -> None: ... + id: str + def __init__(self, raw_transaction: _Optional[str] = ..., id: _Optional[str] = ...) -> None: ... class PayloadTransfer(_message.Message): __slots__ = ("sender", "receiver", "amount") @@ -216,27 +151,19 @@ class PayloadTransfer(_message.Message): sender: str receiver: str amount: int - def __init__( - self, - sender: _Optional[str] = ..., - receiver: _Optional[str] = ..., - amount: _Optional[int] = ..., - ) -> None: ... + def __init__(self, sender: _Optional[str] = ..., receiver: _Optional[str] = ..., amount: _Optional[int] = ...) -> None: ... class PayloadBond(_message.Message): - __slots__ = ("sender", "receiver", "stake") + __slots__ = ("sender", "receiver", "stake", "public_key") SENDER_FIELD_NUMBER: _ClassVar[int] RECEIVER_FIELD_NUMBER: _ClassVar[int] STAKE_FIELD_NUMBER: _ClassVar[int] + PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] sender: str receiver: str stake: int - def __init__( - self, - sender: _Optional[str] = ..., - receiver: _Optional[str] = ..., - stake: _Optional[int] = ..., - ) -> None: ... + public_key: str + def __init__(self, sender: _Optional[str] = ..., receiver: _Optional[str] = ..., stake: _Optional[int] = ..., public_key: _Optional[str] = ...) -> None: ... class PayloadSortition(_message.Message): __slots__ = ("address", "proof") @@ -244,9 +171,7 @@ class PayloadSortition(_message.Message): PROOF_FIELD_NUMBER: _ClassVar[int] address: str proof: str - def __init__( - self, address: _Optional[str] = ..., proof: _Optional[str] = ... - ) -> None: ... + def __init__(self, address: _Optional[str] = ..., proof: _Optional[str] = ...) -> None: ... class PayloadUnbond(_message.Message): __slots__ = ("validator",) @@ -255,34 +180,17 @@ class PayloadUnbond(_message.Message): def __init__(self, validator: _Optional[str] = ...) -> None: ... class PayloadWithdraw(_message.Message): - __slots__ = ("to", "amount") - FROM_FIELD_NUMBER: _ClassVar[int] - TO_FIELD_NUMBER: _ClassVar[int] + __slots__ = ("validator_address", "account_address", "amount") + VALIDATOR_ADDRESS_FIELD_NUMBER: _ClassVar[int] + ACCOUNT_ADDRESS_FIELD_NUMBER: _ClassVar[int] AMOUNT_FIELD_NUMBER: _ClassVar[int] - to: str + validator_address: str + account_address: str amount: int - def __init__( - self, to: _Optional[str] = ..., amount: _Optional[int] = ..., **kwargs - ) -> None: ... + def __init__(self, validator_address: _Optional[str] = ..., account_address: _Optional[str] = ..., amount: _Optional[int] = ...) -> None: ... class TransactionInfo(_message.Message): - __slots__ = ( - "id", - "data", - "version", - "lock_time", - "value", - "fee", - "payload_type", - "transfer", - "bond", - "sortition", - "unbond", - "withdraw", - "memo", - "public_key", - "signature", - ) + __slots__ = ("id", "data", "version", "lock_time", "value", "fee", "payload_type", "transfer", "bond", "sortition", "unbond", "withdraw", "memo", "public_key", "signature") ID_FIELD_NUMBER: _ClassVar[int] DATA_FIELD_NUMBER: _ClassVar[int] VERSION_FIELD_NUMBER: _ClassVar[int] @@ -313,21 +221,4 @@ class TransactionInfo(_message.Message): memo: str public_key: str signature: str - def __init__( - self, - id: _Optional[str] = ..., - data: _Optional[str] = ..., - version: _Optional[int] = ..., - lock_time: _Optional[int] = ..., - value: _Optional[int] = ..., - fee: _Optional[int] = ..., - payload_type: _Optional[_Union[PayloadType, str]] = ..., - transfer: _Optional[_Union[PayloadTransfer, _Mapping]] = ..., - bond: _Optional[_Union[PayloadBond, _Mapping]] = ..., - sortition: _Optional[_Union[PayloadSortition, _Mapping]] = ..., - unbond: _Optional[_Union[PayloadUnbond, _Mapping]] = ..., - withdraw: _Optional[_Union[PayloadWithdraw, _Mapping]] = ..., - memo: _Optional[str] = ..., - public_key: _Optional[str] = ..., - signature: _Optional[str] = ..., - ) -> None: ... + def __init__(self, id: _Optional[str] = ..., data: _Optional[str] = ..., version: _Optional[int] = ..., lock_time: _Optional[int] = ..., value: _Optional[int] = ..., fee: _Optional[int] = ..., payload_type: _Optional[_Union[PayloadType, str]] = ..., transfer: _Optional[_Union[PayloadTransfer, _Mapping]] = ..., bond: _Optional[_Union[PayloadBond, _Mapping]] = ..., sortition: _Optional[_Union[PayloadSortition, _Mapping]] = ..., unbond: _Optional[_Union[PayloadUnbond, _Mapping]] = ..., withdraw: _Optional[_Union[PayloadWithdraw, _Mapping]] = ..., memo: _Optional[str] = ..., public_key: _Optional[str] = ..., signature: _Optional[str] = ...) -> None: ... diff --git a/pactus/rpc/transaction_pb2_grpc.py b/pactus/rpc/transaction_pb2_grpc.py index e6b4dae..a41535b 100644 --- a/pactus/rpc/transaction_pb2_grpc.py +++ b/pactus/rpc/transaction_pb2_grpc.py @@ -1,6 +1,5 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" - import grpc from . import transaction_pb2 as transaction__pb2 @@ -18,40 +17,40 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.GetTransaction = channel.unary_unary( - "/pactus.Transaction/GetTransaction", - request_serializer=transaction__pb2.GetTransactionRequest.SerializeToString, - response_deserializer=transaction__pb2.GetTransactionResponse.FromString, - ) + '/pactus.Transaction/GetTransaction', + request_serializer=transaction__pb2.GetTransactionRequest.SerializeToString, + response_deserializer=transaction__pb2.GetTransactionResponse.FromString, + ) self.CalculateFee = channel.unary_unary( - "/pactus.Transaction/CalculateFee", - request_serializer=transaction__pb2.CalculateFeeRequest.SerializeToString, - response_deserializer=transaction__pb2.CalculateFeeResponse.FromString, - ) + '/pactus.Transaction/CalculateFee', + request_serializer=transaction__pb2.CalculateFeeRequest.SerializeToString, + response_deserializer=transaction__pb2.CalculateFeeResponse.FromString, + ) self.BroadcastTransaction = channel.unary_unary( - "/pactus.Transaction/BroadcastTransaction", - request_serializer=transaction__pb2.BroadcastTransactionRequest.SerializeToString, - response_deserializer=transaction__pb2.BroadcastTransactionResponse.FromString, - ) + '/pactus.Transaction/BroadcastTransaction', + request_serializer=transaction__pb2.BroadcastTransactionRequest.SerializeToString, + response_deserializer=transaction__pb2.BroadcastTransactionResponse.FromString, + ) self.GetRawTransferTransaction = channel.unary_unary( - "/pactus.Transaction/GetRawTransferTransaction", - request_serializer=transaction__pb2.GetRawTransferTransactionRequest.SerializeToString, - response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, - ) + '/pactus.Transaction/GetRawTransferTransaction', + request_serializer=transaction__pb2.GetRawTransferTransactionRequest.SerializeToString, + response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, + ) self.GetRawBondTransaction = channel.unary_unary( - "/pactus.Transaction/GetRawBondTransaction", - request_serializer=transaction__pb2.GetRawBondTransactionRequest.SerializeToString, - response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, - ) + '/pactus.Transaction/GetRawBondTransaction', + request_serializer=transaction__pb2.GetRawBondTransactionRequest.SerializeToString, + response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, + ) self.GetRawUnbondTransaction = channel.unary_unary( - "/pactus.Transaction/GetRawUnbondTransaction", - request_serializer=transaction__pb2.GetRawUnbondTransactionRequest.SerializeToString, - response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, - ) + '/pactus.Transaction/GetRawUnbondTransaction', + request_serializer=transaction__pb2.GetRawUnbondTransactionRequest.SerializeToString, + response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, + ) self.GetRawWithdrawTransaction = channel.unary_unary( - "/pactus.Transaction/GetRawWithdrawTransaction", - request_serializer=transaction__pb2.GetRawWithdrawTransactionRequest.SerializeToString, - response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, - ) + '/pactus.Transaction/GetRawWithdrawTransaction', + request_serializer=transaction__pb2.GetRawWithdrawTransactionRequest.SerializeToString, + response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, + ) class TransactionServicer(object): @@ -64,297 +63,217 @@ def GetTransaction(self, request, context): parameters. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def CalculateFee(self, request, context): """CalculateFee calculates the transaction fee based on the specified amount and payload type. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def BroadcastTransaction(self, request, context): - """BroadcastTransaction broadcasts a signed transaction to the network.""" + """BroadcastTransaction broadcasts a signed transaction to the network. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetRawTransferTransaction(self, request, context): - """GetRawTransferTransaction retrieves raw details of a transfer transaction.""" + """GetRawTransferTransaction retrieves raw details of a transfer transaction. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetRawBondTransaction(self, request, context): - """GetRawBondTransaction retrieves raw details of a bond transaction.""" + """GetRawBondTransaction retrieves raw details of a bond transaction. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetRawUnbondTransaction(self, request, context): - """GetRawUnbondTransaction retrieves raw details of an unbond transaction.""" + """GetRawUnbondTransaction retrieves raw details of an unbond transaction. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetRawWithdrawTransaction(self, request, context): - """GetRawWithdrawTransaction retrieves raw details of a withdraw transaction.""" + """GetRawWithdrawTransaction retrieves raw details of a withdraw transaction. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_TransactionServicer_to_server(servicer, server): rpc_method_handlers = { - "GetTransaction": grpc.unary_unary_rpc_method_handler( - servicer.GetTransaction, - request_deserializer=transaction__pb2.GetTransactionRequest.FromString, - response_serializer=transaction__pb2.GetTransactionResponse.SerializeToString, - ), - "CalculateFee": grpc.unary_unary_rpc_method_handler( - servicer.CalculateFee, - request_deserializer=transaction__pb2.CalculateFeeRequest.FromString, - response_serializer=transaction__pb2.CalculateFeeResponse.SerializeToString, - ), - "BroadcastTransaction": grpc.unary_unary_rpc_method_handler( - servicer.BroadcastTransaction, - request_deserializer=transaction__pb2.BroadcastTransactionRequest.FromString, - response_serializer=transaction__pb2.BroadcastTransactionResponse.SerializeToString, - ), - "GetRawTransferTransaction": grpc.unary_unary_rpc_method_handler( - servicer.GetRawTransferTransaction, - request_deserializer=transaction__pb2.GetRawTransferTransactionRequest.FromString, - response_serializer=transaction__pb2.GetRawTransactionResponse.SerializeToString, - ), - "GetRawBondTransaction": grpc.unary_unary_rpc_method_handler( - servicer.GetRawBondTransaction, - request_deserializer=transaction__pb2.GetRawBondTransactionRequest.FromString, - response_serializer=transaction__pb2.GetRawTransactionResponse.SerializeToString, - ), - "GetRawUnbondTransaction": grpc.unary_unary_rpc_method_handler( - servicer.GetRawUnbondTransaction, - request_deserializer=transaction__pb2.GetRawUnbondTransactionRequest.FromString, - response_serializer=transaction__pb2.GetRawTransactionResponse.SerializeToString, - ), - "GetRawWithdrawTransaction": grpc.unary_unary_rpc_method_handler( - servicer.GetRawWithdrawTransaction, - request_deserializer=transaction__pb2.GetRawWithdrawTransactionRequest.FromString, - response_serializer=transaction__pb2.GetRawTransactionResponse.SerializeToString, - ), + 'GetTransaction': grpc.unary_unary_rpc_method_handler( + servicer.GetTransaction, + request_deserializer=transaction__pb2.GetTransactionRequest.FromString, + response_serializer=transaction__pb2.GetTransactionResponse.SerializeToString, + ), + 'CalculateFee': grpc.unary_unary_rpc_method_handler( + servicer.CalculateFee, + request_deserializer=transaction__pb2.CalculateFeeRequest.FromString, + response_serializer=transaction__pb2.CalculateFeeResponse.SerializeToString, + ), + 'BroadcastTransaction': grpc.unary_unary_rpc_method_handler( + servicer.BroadcastTransaction, + request_deserializer=transaction__pb2.BroadcastTransactionRequest.FromString, + response_serializer=transaction__pb2.BroadcastTransactionResponse.SerializeToString, + ), + 'GetRawTransferTransaction': grpc.unary_unary_rpc_method_handler( + servicer.GetRawTransferTransaction, + request_deserializer=transaction__pb2.GetRawTransferTransactionRequest.FromString, + response_serializer=transaction__pb2.GetRawTransactionResponse.SerializeToString, + ), + 'GetRawBondTransaction': grpc.unary_unary_rpc_method_handler( + servicer.GetRawBondTransaction, + request_deserializer=transaction__pb2.GetRawBondTransactionRequest.FromString, + response_serializer=transaction__pb2.GetRawTransactionResponse.SerializeToString, + ), + 'GetRawUnbondTransaction': grpc.unary_unary_rpc_method_handler( + servicer.GetRawUnbondTransaction, + request_deserializer=transaction__pb2.GetRawUnbondTransactionRequest.FromString, + response_serializer=transaction__pb2.GetRawTransactionResponse.SerializeToString, + ), + 'GetRawWithdrawTransaction': grpc.unary_unary_rpc_method_handler( + servicer.GetRawWithdrawTransaction, + request_deserializer=transaction__pb2.GetRawWithdrawTransactionRequest.FromString, + response_serializer=transaction__pb2.GetRawTransactionResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - "pactus.Transaction", rpc_method_handlers - ) + 'pactus.Transaction', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) -# This class is part of an EXPERIMENTAL API. + # This class is part of an EXPERIMENTAL API. class Transaction(object): """Transaction service defines various RPC methods for interacting with transactions. """ @staticmethod - def GetTransaction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetTransaction(request, target, - "/pactus.Transaction/GetTransaction", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Transaction/GetTransaction', transaction__pb2.GetTransactionRequest.SerializeToString, transaction__pb2.GetTransactionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def CalculateFee( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def CalculateFee(request, target, - "/pactus.Transaction/CalculateFee", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Transaction/CalculateFee', transaction__pb2.CalculateFeeRequest.SerializeToString, transaction__pb2.CalculateFeeResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def BroadcastTransaction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def BroadcastTransaction(request, target, - "/pactus.Transaction/BroadcastTransaction", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Transaction/BroadcastTransaction', transaction__pb2.BroadcastTransactionRequest.SerializeToString, transaction__pb2.BroadcastTransactionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetRawTransferTransaction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetRawTransferTransaction(request, target, - "/pactus.Transaction/GetRawTransferTransaction", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Transaction/GetRawTransferTransaction', transaction__pb2.GetRawTransferTransactionRequest.SerializeToString, transaction__pb2.GetRawTransactionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetRawBondTransaction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetRawBondTransaction(request, target, - "/pactus.Transaction/GetRawBondTransaction", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Transaction/GetRawBondTransaction', transaction__pb2.GetRawBondTransactionRequest.SerializeToString, transaction__pb2.GetRawTransactionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetRawUnbondTransaction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetRawUnbondTransaction(request, target, - "/pactus.Transaction/GetRawUnbondTransaction", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Transaction/GetRawUnbondTransaction', transaction__pb2.GetRawUnbondTransactionRequest.SerializeToString, transaction__pb2.GetRawTransactionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetRawWithdrawTransaction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetRawWithdrawTransaction(request, target, - "/pactus.Transaction/GetRawWithdrawTransaction", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Transaction/GetRawWithdrawTransaction', transaction__pb2.GetRawWithdrawTransactionRequest.SerializeToString, transaction__pb2.GetRawTransactionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pactus/rpc/utils_pb2.py b/pactus/rpc/utils_pb2.py index 411b900..2fbe394 100644 --- a/pactus/rpc/utils_pb2.py +++ b/pactus/rpc/utils_pb2.py @@ -2,7 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: utils.proto """Generated protocol buffer code.""" - from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,25 +11,32 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x0butils.proto\x12\x06pactus"]\n SignMessageWithPrivateKeyRequest\x12\x1f\n\x0bprivate_key\x18\x01 \x01(\tR\nprivateKey\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message"A\n!SignMessageWithPrivateKeyResponse\x12\x1c\n\tsignature\x18\x01 \x01(\tR\tsignature"m\n\x14VerifyMessageRequest\x12\x18\n\x07message\x18\x01 \x01(\tR\x07message\x12\x1c\n\tsignature\x18\x02 \x01(\tR\tsignature\x12\x1d\n\npublic_key\x18\x03 \x01(\tR\tpublicKey"2\n\x15VerifyMessageResponse\x12\x19\n\x08is_valid\x18\x01 \x01(\x08R\x07isValid2\xc7\x01\n\x05Utils\x12p\n\x19SignMessageWithPrivateKey\x12(.pactus.SignMessageWithPrivateKeyRequest\x1a).pactus.SignMessageWithPrivateKeyResponse\x12L\n\rVerifyMessage\x12\x1c.pactus.VerifyMessageRequest\x1a\x1d.pactus.VerifyMessageResponseB@\n\x0cpactus.utilsZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3' -) + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0butils.proto\x12\x06pactus\"]\n SignMessageWithPrivateKeyRequest\x12\x1f\n\x0bprivate_key\x18\x01 \x01(\tR\nprivateKey\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\"A\n!SignMessageWithPrivateKeyResponse\x12\x1c\n\tsignature\x18\x01 \x01(\tR\tsignature\"m\n\x14VerifyMessageRequest\x12\x18\n\x07message\x18\x01 \x01(\tR\x07message\x12\x1c\n\tsignature\x18\x02 \x01(\tR\tsignature\x12\x1d\n\npublic_key\x18\x03 \x01(\tR\tpublicKey\"2\n\x15VerifyMessageResponse\x12\x19\n\x08is_valid\x18\x01 \x01(\x08R\x07isValid\"A\n\x1e\x42LSPublicKeyAggregationRequest\x12\x1f\n\x0bpublic_keys\x18\x01 \x03(\tR\npublicKeys\"Z\n\x1f\x42LSPublicKeyAggregationResponse\x12\x1d\n\npublic_key\x18\x01 \x01(\tR\tpublicKey\x12\x18\n\x07\x61\x64\x64ress\x18\x02 \x01(\tR\x07\x61\x64\x64ress\"@\n\x1e\x42LSSignatureAggregationRequest\x12\x1e\n\nsignatures\x18\x01 \x03(\tR\nsignatures\"?\n\x1f\x42LSSignatureAggregationResponse\x12\x1c\n\tsignature\x18\x01 \x01(\tR\tsignature2\x9f\x03\n\x05Utils\x12p\n\x19SignMessageWithPrivateKey\x12(.pactus.SignMessageWithPrivateKeyRequest\x1a).pactus.SignMessageWithPrivateKeyResponse\x12L\n\rVerifyMessage\x12\x1c.pactus.VerifyMessageRequest\x1a\x1d.pactus.VerifyMessageResponse\x12j\n\x17\x42LSPublicKeyAggregation\x12&.pactus.BLSPublicKeyAggregationRequest\x1a\'.pactus.BLSPublicKeyAggregationResponse\x12j\n\x17\x42LSSignatureAggregation\x12&.pactus.BLSSignatureAggregationRequest\x1a\'.pactus.BLSSignatureAggregationResponseB@\n\x0cpactus.utilsZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "utils_pb2", globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'utils_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = ( - b"\n\014pactus.utilsZ0github.com/pactus-project/pactus/www/grpc/pactus" - ) - _SIGNMESSAGEWITHPRIVATEKEYREQUEST._serialized_start = 23 - _SIGNMESSAGEWITHPRIVATEKEYREQUEST._serialized_end = 116 - _SIGNMESSAGEWITHPRIVATEKEYRESPONSE._serialized_start = 118 - _SIGNMESSAGEWITHPRIVATEKEYRESPONSE._serialized_end = 183 - _VERIFYMESSAGEREQUEST._serialized_start = 185 - _VERIFYMESSAGEREQUEST._serialized_end = 294 - _VERIFYMESSAGERESPONSE._serialized_start = 296 - _VERIFYMESSAGERESPONSE._serialized_end = 346 - _UTILS._serialized_start = 349 - _UTILS._serialized_end = 548 + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\014pactus.utilsZ0github.com/pactus-project/pactus/www/grpc/pactus' + _SIGNMESSAGEWITHPRIVATEKEYREQUEST._serialized_start=23 + _SIGNMESSAGEWITHPRIVATEKEYREQUEST._serialized_end=116 + _SIGNMESSAGEWITHPRIVATEKEYRESPONSE._serialized_start=118 + _SIGNMESSAGEWITHPRIVATEKEYRESPONSE._serialized_end=183 + _VERIFYMESSAGEREQUEST._serialized_start=185 + _VERIFYMESSAGEREQUEST._serialized_end=294 + _VERIFYMESSAGERESPONSE._serialized_start=296 + _VERIFYMESSAGERESPONSE._serialized_end=346 + _BLSPUBLICKEYAGGREGATIONREQUEST._serialized_start=348 + _BLSPUBLICKEYAGGREGATIONREQUEST._serialized_end=413 + _BLSPUBLICKEYAGGREGATIONRESPONSE._serialized_start=415 + _BLSPUBLICKEYAGGREGATIONRESPONSE._serialized_end=505 + _BLSSIGNATUREAGGREGATIONREQUEST._serialized_start=507 + _BLSSIGNATUREAGGREGATIONREQUEST._serialized_end=571 + _BLSSIGNATUREAGGREGATIONRESPONSE._serialized_start=573 + _BLSSIGNATUREAGGREGATIONRESPONSE._serialized_end=636 + _UTILS._serialized_start=639 + _UTILS._serialized_end=1054 # @@protoc_insertion_point(module_scope) diff --git a/pactus/rpc/utils_pb2.pyi b/pactus/rpc/utils_pb2.pyi index c533b4d..cb74ff2 100644 --- a/pactus/rpc/utils_pb2.pyi +++ b/pactus/rpc/utils_pb2.pyi @@ -1,6 +1,7 @@ +from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Optional as _Optional +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Optional as _Optional DESCRIPTOR: _descriptor.FileDescriptor @@ -10,9 +11,7 @@ class SignMessageWithPrivateKeyRequest(_message.Message): MESSAGE_FIELD_NUMBER: _ClassVar[int] private_key: str message: str - def __init__( - self, private_key: _Optional[str] = ..., message: _Optional[str] = ... - ) -> None: ... + def __init__(self, private_key: _Optional[str] = ..., message: _Optional[str] = ...) -> None: ... class SignMessageWithPrivateKeyResponse(_message.Message): __slots__ = ("signature",) @@ -28,15 +27,36 @@ class VerifyMessageRequest(_message.Message): message: str signature: str public_key: str - def __init__( - self, - message: _Optional[str] = ..., - signature: _Optional[str] = ..., - public_key: _Optional[str] = ..., - ) -> None: ... + def __init__(self, message: _Optional[str] = ..., signature: _Optional[str] = ..., public_key: _Optional[str] = ...) -> None: ... class VerifyMessageResponse(_message.Message): __slots__ = ("is_valid",) IS_VALID_FIELD_NUMBER: _ClassVar[int] is_valid: bool def __init__(self, is_valid: bool = ...) -> None: ... + +class BLSPublicKeyAggregationRequest(_message.Message): + __slots__ = ("public_keys",) + PUBLIC_KEYS_FIELD_NUMBER: _ClassVar[int] + public_keys: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, public_keys: _Optional[_Iterable[str]] = ...) -> None: ... + +class BLSPublicKeyAggregationResponse(_message.Message): + __slots__ = ("public_key", "address") + PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] + ADDRESS_FIELD_NUMBER: _ClassVar[int] + public_key: str + address: str + def __init__(self, public_key: _Optional[str] = ..., address: _Optional[str] = ...) -> None: ... + +class BLSSignatureAggregationRequest(_message.Message): + __slots__ = ("signatures",) + SIGNATURES_FIELD_NUMBER: _ClassVar[int] + signatures: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, signatures: _Optional[_Iterable[str]] = ...) -> None: ... + +class BLSSignatureAggregationResponse(_message.Message): + __slots__ = ("signature",) + SIGNATURE_FIELD_NUMBER: _ClassVar[int] + signature: str + def __init__(self, signature: _Optional[str] = ...) -> None: ... diff --git a/pactus/rpc/utils_pb2_grpc.py b/pactus/rpc/utils_pb2_grpc.py index 38126f5..d6849ab 100644 --- a/pactus/rpc/utils_pb2_grpc.py +++ b/pactus/rpc/utils_pb2_grpc.py @@ -1,6 +1,5 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" - import grpc from . import utils_pb2 as utils__pb2 @@ -18,15 +17,25 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.SignMessageWithPrivateKey = channel.unary_unary( - "/pactus.Utils/SignMessageWithPrivateKey", - request_serializer=utils__pb2.SignMessageWithPrivateKeyRequest.SerializeToString, - response_deserializer=utils__pb2.SignMessageWithPrivateKeyResponse.FromString, - ) + '/pactus.Utils/SignMessageWithPrivateKey', + request_serializer=utils__pb2.SignMessageWithPrivateKeyRequest.SerializeToString, + response_deserializer=utils__pb2.SignMessageWithPrivateKeyResponse.FromString, + ) self.VerifyMessage = channel.unary_unary( - "/pactus.Utils/VerifyMessage", - request_serializer=utils__pb2.VerifyMessageRequest.SerializeToString, - response_deserializer=utils__pb2.VerifyMessageResponse.FromString, - ) + '/pactus.Utils/VerifyMessage', + request_serializer=utils__pb2.VerifyMessageRequest.SerializeToString, + response_deserializer=utils__pb2.VerifyMessageResponse.FromString, + ) + self.BLSPublicKeyAggregation = channel.unary_unary( + '/pactus.Utils/BLSPublicKeyAggregation', + request_serializer=utils__pb2.BLSPublicKeyAggregationRequest.SerializeToString, + response_deserializer=utils__pb2.BLSPublicKeyAggregationResponse.FromString, + ) + self.BLSSignatureAggregation = channel.unary_unary( + '/pactus.Utils/BLSSignatureAggregation', + request_serializer=utils__pb2.BLSSignatureAggregationRequest.SerializeToString, + response_deserializer=utils__pb2.BLSSignatureAggregationResponse.FromString, + ) class UtilsServicer(object): @@ -35,97 +44,132 @@ class UtilsServicer(object): """ def SignMessageWithPrivateKey(self, request, context): - """SignMessageWithPrivateKey sign message with provided private key.""" + """SignMessageWithPrivateKey signs message with provided private key. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def VerifyMessage(self, request, context): - """VerifyMessage verify signature with public key and message""" + """VerifyMessage verifies signature with public key and message. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BLSPublicKeyAggregation(self, request, context): + """BLSPublicKeyAggregation aggregates bls public keys. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BLSSignatureAggregation(self, request, context): + """BLSSignatureAggregation aggregates bls signatures. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_UtilsServicer_to_server(servicer, server): rpc_method_handlers = { - "SignMessageWithPrivateKey": grpc.unary_unary_rpc_method_handler( - servicer.SignMessageWithPrivateKey, - request_deserializer=utils__pb2.SignMessageWithPrivateKeyRequest.FromString, - response_serializer=utils__pb2.SignMessageWithPrivateKeyResponse.SerializeToString, - ), - "VerifyMessage": grpc.unary_unary_rpc_method_handler( - servicer.VerifyMessage, - request_deserializer=utils__pb2.VerifyMessageRequest.FromString, - response_serializer=utils__pb2.VerifyMessageResponse.SerializeToString, - ), + 'SignMessageWithPrivateKey': grpc.unary_unary_rpc_method_handler( + servicer.SignMessageWithPrivateKey, + request_deserializer=utils__pb2.SignMessageWithPrivateKeyRequest.FromString, + response_serializer=utils__pb2.SignMessageWithPrivateKeyResponse.SerializeToString, + ), + 'VerifyMessage': grpc.unary_unary_rpc_method_handler( + servicer.VerifyMessage, + request_deserializer=utils__pb2.VerifyMessageRequest.FromString, + response_serializer=utils__pb2.VerifyMessageResponse.SerializeToString, + ), + 'BLSPublicKeyAggregation': grpc.unary_unary_rpc_method_handler( + servicer.BLSPublicKeyAggregation, + request_deserializer=utils__pb2.BLSPublicKeyAggregationRequest.FromString, + response_serializer=utils__pb2.BLSPublicKeyAggregationResponse.SerializeToString, + ), + 'BLSSignatureAggregation': grpc.unary_unary_rpc_method_handler( + servicer.BLSSignatureAggregation, + request_deserializer=utils__pb2.BLSSignatureAggregationRequest.FromString, + response_serializer=utils__pb2.BLSSignatureAggregationResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - "pactus.Utils", rpc_method_handlers - ) + 'pactus.Utils', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) -# This class is part of an EXPERIMENTAL API. + # This class is part of an EXPERIMENTAL API. class Utils(object): """Utils service defines RPC methods for utility functions such as message signing and verification. """ @staticmethod - def SignMessageWithPrivateKey( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def SignMessageWithPrivateKey(request, target, - "/pactus.Utils/SignMessageWithPrivateKey", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Utils/SignMessageWithPrivateKey', utils__pb2.SignMessageWithPrivateKeyRequest.SerializeToString, utils__pb2.SignMessageWithPrivateKeyResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def VerifyMessage( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def VerifyMessage(request, target, - "/pactus.Utils/VerifyMessage", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Utils/VerifyMessage', utils__pb2.VerifyMessageRequest.SerializeToString, utils__pb2.VerifyMessageResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def BLSPublicKeyAggregation(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Utils/BLSPublicKeyAggregation', + utils__pb2.BLSPublicKeyAggregationRequest.SerializeToString, + utils__pb2.BLSPublicKeyAggregationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def BLSSignatureAggregation(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Utils/BLSSignatureAggregation', + utils__pb2.BLSSignatureAggregationRequest.SerializeToString, + utils__pb2.BLSSignatureAggregationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pactus/rpc/wallet_pb2.py b/pactus/rpc/wallet_pb2.py index f8e1dca..0fa2ae8 100644 --- a/pactus/rpc/wallet_pb2.py +++ b/pactus/rpc/wallet_pb2.py @@ -2,7 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: wallet.proto """Generated protocol buffer code.""" - from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -15,63 +14,84 @@ from . import transaction_pb2 as transaction__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x0cwallet.proto\x12\x06pactus\x1a\x11transaction.proto"p\n\x0b\x41\x64\x64ressInfo\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x1d\n\npublic_key\x18\x02 \x01(\tR\tpublicKey\x12\x14\n\x05label\x18\x03 \x01(\tR\x05label\x12\x12\n\x04path\x18\x04 \x01(\tR\x04path"\xa5\x01\n\x0bHistoryInfo\x12%\n\x0etransaction_id\x18\x01 \x01(\tR\rtransactionId\x12\x12\n\x04time\x18\x02 \x01(\rR\x04time\x12!\n\x0cpayload_type\x18\x03 \x01(\tR\x0bpayloadType\x12 \n\x0b\x64\x65scription\x18\x04 \x01(\tR\x0b\x64\x65scription\x12\x16\n\x06\x61mount\x18\x05 \x01(\x03R\x06\x61mount"U\n\x18GetAddressHistoryRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x18\n\x07\x61\x64\x64ress\x18\x02 \x01(\tR\x07\x61\x64\x64ress"S\n\x19GetAddressHistoryResponse\x12\x36\n\x0chistory_info\x18\x01 \x03(\x0b\x32\x13.pactus.HistoryInfoR\x0bhistoryInfo"\x85\x01\n\x14GetNewAddressRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x36\n\x0c\x61\x64\x64ress_type\x18\x02 \x01(\x0e\x32\x13.pactus.AddressTypeR\x0b\x61\x64\x64ressType\x12\x14\n\x05label\x18\x03 \x01(\tR\x05label"p\n\x15GetNewAddressResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x36\n\x0c\x61\x64\x64ress_info\x18\x02 \x01(\x0b\x32\x13.pactus.AddressInfoR\x0b\x61\x64\x64ressInfo"o\n\x14RestoreWalletRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x1a\n\x08mnemonic\x18\x02 \x01(\tR\x08mnemonic\x12\x1a\n\x08password\x18\x03 \x01(\tR\x08password"8\n\x15RestoreWalletResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName"R\n\x13\x43reateWalletRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x1a\n\x08password\x18\x04 \x01(\tR\x08password"2\n\x14\x43reateWalletResponse\x12\x1a\n\x08mnemonic\x18\x02 \x01(\tR\x08mnemonic"4\n\x11LoadWalletRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName"5\n\x12LoadWalletResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName"6\n\x13UnloadWalletRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName"7\n\x14UnloadWalletResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName";\n\x1aGetValidatorAddressRequest\x12\x1d\n\npublic_key\x18\x01 \x01(\tR\tpublicKey"7\n\x1bGetValidatorAddressResponse\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress"\x81\x01\n\x19SignRawTransactionRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\'\n\x0fraw_transaction\x18\x02 \x01(\tR\x0erawTransaction\x12\x1a\n\x08password\x18\x03 \x01(\tR\x08password"y\n\x1aSignRawTransactionResponse\x12%\n\x0etransaction_id\x18\x01 \x01(\tR\rtransactionId\x12\x34\n\x16signed_raw_transaction\x18\x02 \x01(\tR\x14signedRawTransaction"9\n\x16GetTotalBalanceRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName"_\n\x17GetTotalBalanceResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12#\n\rtotal_balance\x18\x02 \x01(\x03R\x0ctotalBalance"\x85\x01\n\x12SignMessageRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x1a\n\x08password\x18\x02 \x01(\tR\x08password\x12\x18\n\x07\x61\x64\x64ress\x18\x03 \x01(\tR\x07\x61\x64\x64ress\x12\x18\n\x07message\x18\x04 \x01(\tR\x07message"3\n\x13SignMessageResponse\x12\x1c\n\tsignature\x18\x01 \x01(\tR\tsignature*b\n\x0b\x41\x64\x64ressType\x12\x19\n\x15\x41\x44\x44RESS_TYPE_TREASURY\x10\x00\x12\x1a\n\x16\x41\x44\x44RESS_TYPE_VALIDATOR\x10\x01\x12\x1c\n\x18\x41\x44\x44RESS_TYPE_BLS_ACCOUNT\x10\x02\x32\xb2\x06\n\x06Wallet\x12I\n\x0c\x43reateWallet\x12\x1b.pactus.CreateWalletRequest\x1a\x1c.pactus.CreateWalletResponse\x12L\n\rRestoreWallet\x12\x1c.pactus.RestoreWalletRequest\x1a\x1d.pactus.RestoreWalletResponse\x12\x43\n\nLoadWallet\x12\x19.pactus.LoadWalletRequest\x1a\x1a.pactus.LoadWalletResponse\x12I\n\x0cUnloadWallet\x12\x1b.pactus.UnloadWalletRequest\x1a\x1c.pactus.UnloadWalletResponse\x12R\n\x0fGetTotalBalance\x12\x1e.pactus.GetTotalBalanceRequest\x1a\x1f.pactus.GetTotalBalanceResponse\x12[\n\x12SignRawTransaction\x12!.pactus.SignRawTransactionRequest\x1a".pactus.SignRawTransactionResponse\x12^\n\x13GetValidatorAddress\x12".pactus.GetValidatorAddressRequest\x1a#.pactus.GetValidatorAddressResponse\x12L\n\rGetNewAddress\x12\x1c.pactus.GetNewAddressRequest\x1a\x1d.pactus.GetNewAddressResponse\x12X\n\x11GetAddressHistory\x12 .pactus.GetAddressHistoryRequest\x1a!.pactus.GetAddressHistoryResponse\x12\x46\n\x0bSignMessage\x12\x1a.pactus.SignMessageRequest\x1a\x1b.pactus.SignMessageResponseBA\n\rpactus.walletZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3' -) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cwallet.proto\x12\x06pactus\x1a\x11transaction.proto\"p\n\x0b\x41\x64\x64ressInfo\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x1d\n\npublic_key\x18\x02 \x01(\tR\tpublicKey\x12\x14\n\x05label\x18\x03 \x01(\tR\x05label\x12\x12\n\x04path\x18\x04 \x01(\tR\x04path\"\xa5\x01\n\x0bHistoryInfo\x12%\n\x0etransaction_id\x18\x01 \x01(\tR\rtransactionId\x12\x12\n\x04time\x18\x02 \x01(\rR\x04time\x12!\n\x0cpayload_type\x18\x03 \x01(\tR\x0bpayloadType\x12 \n\x0b\x64\x65scription\x18\x04 \x01(\tR\x0b\x64\x65scription\x12\x16\n\x06\x61mount\x18\x05 \x01(\x03R\x06\x61mount\"U\n\x18GetAddressHistoryRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x18\n\x07\x61\x64\x64ress\x18\x02 \x01(\tR\x07\x61\x64\x64ress\"S\n\x19GetAddressHistoryResponse\x12\x36\n\x0chistory_info\x18\x01 \x03(\x0b\x32\x13.pactus.HistoryInfoR\x0bhistoryInfo\"\xa1\x01\n\x14GetNewAddressRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x36\n\x0c\x61\x64\x64ress_type\x18\x02 \x01(\x0e\x32\x13.pactus.AddressTypeR\x0b\x61\x64\x64ressType\x12\x14\n\x05label\x18\x03 \x01(\tR\x05label\x12\x1a\n\x08password\x18\x04 \x01(\tR\x08password\"p\n\x15GetNewAddressResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x36\n\x0c\x61\x64\x64ress_info\x18\x02 \x01(\x0b\x32\x13.pactus.AddressInfoR\x0b\x61\x64\x64ressInfo\"o\n\x14RestoreWalletRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x1a\n\x08mnemonic\x18\x02 \x01(\tR\x08mnemonic\x12\x1a\n\x08password\x18\x03 \x01(\tR\x08password\"8\n\x15RestoreWalletResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\"R\n\x13\x43reateWalletRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x1a\n\x08password\x18\x04 \x01(\tR\x08password\"2\n\x14\x43reateWalletResponse\x12\x1a\n\x08mnemonic\x18\x02 \x01(\tR\x08mnemonic\"4\n\x11LoadWalletRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\"5\n\x12LoadWalletResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\"6\n\x13UnloadWalletRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\"7\n\x14UnloadWalletResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\";\n\x1aGetValidatorAddressRequest\x12\x1d\n\npublic_key\x18\x01 \x01(\tR\tpublicKey\"7\n\x1bGetValidatorAddressResponse\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"\x81\x01\n\x19SignRawTransactionRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\'\n\x0fraw_transaction\x18\x02 \x01(\tR\x0erawTransaction\x12\x1a\n\x08password\x18\x03 \x01(\tR\x08password\"y\n\x1aSignRawTransactionResponse\x12%\n\x0etransaction_id\x18\x01 \x01(\tR\rtransactionId\x12\x34\n\x16signed_raw_transaction\x18\x02 \x01(\tR\x14signedRawTransaction\"9\n\x16GetTotalBalanceRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\"_\n\x17GetTotalBalanceResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12#\n\rtotal_balance\x18\x02 \x01(\x03R\x0ctotalBalance\"\x85\x01\n\x12SignMessageRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x1a\n\x08password\x18\x02 \x01(\tR\x08password\x12\x18\n\x07\x61\x64\x64ress\x18\x03 \x01(\tR\x07\x61\x64\x64ress\x12\x18\n\x07message\x18\x04 \x01(\tR\x07message\"3\n\x13SignMessageResponse\x12\x1c\n\tsignature\x18\x01 \x01(\tR\tsignature\"7\n\x14GetTotalStakeRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\"Y\n\x15GetTotalStakeResponse\x12\x1f\n\x0btotal_stake\x18\x01 \x01(\x03R\ntotalStake\x12\x1f\n\x0bwallet_name\x18\x02 \x01(\tR\nwalletName\"R\n\x15GetAddressInfoRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x18\n\x07\x61\x64\x64ress\x18\x02 \x01(\tR\x07\x61\x64\x64ress\"\x9c\x01\n\x16GetAddressInfoResponse\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x14\n\x05label\x18\x02 \x01(\tR\x05label\x12\x1d\n\npublic_key\x18\x03 \x01(\tR\tpublicKey\x12\x12\n\x04path\x18\x04 \x01(\tR\x04path\x12\x1f\n\x0bwallet_name\x18\x05 \x01(\tR\nwalletName\"~\n\x0fSetLabelRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x1a\n\x08password\x18\x03 \x01(\tR\x08password\x12\x18\n\x07\x61\x64\x64ress\x18\x04 \x01(\tR\x07\x61\x64\x64ress\x12\x14\n\x05label\x18\x05 \x01(\tR\x05label\"\x12\n\x10SetLabelResponse\"\x13\n\x11ListWalletRequest\".\n\x12ListWalletResponse\x12\x18\n\x07wallets\x18\x01 \x03(\tR\x07wallets\"7\n\x14GetWalletInfoRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\"\xbd\x01\n\x15GetWalletInfoResponse\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\x12\x18\n\x07version\x18\x02 \x01(\x03R\x07version\x12\x18\n\x07network\x18\x03 \x01(\tR\x07network\x12\x1c\n\tencrypted\x18\x04 \x01(\x08R\tencrypted\x12\x12\n\x04uuid\x18\x05 \x01(\tR\x04uuid\x12\x1d\n\ncreated_at\x18\x06 \x01(\x03R\tcreatedAt\"5\n\x12ListAddressRequest\x12\x1f\n\x0bwallet_name\x18\x01 \x01(\tR\nwalletName\">\n\x13ListAddressResponse\x12\'\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32\x13.pactus.AddressInfoR\x04\x64\x61ta*\x84\x01\n\x0b\x41\x64\x64ressType\x12\x19\n\x15\x41\x44\x44RESS_TYPE_TREASURY\x10\x00\x12\x1a\n\x16\x41\x44\x44RESS_TYPE_VALIDATOR\x10\x01\x12\x1c\n\x18\x41\x44\x44RESS_TYPE_BLS_ACCOUNT\x10\x02\x12 \n\x1c\x41\x44\x44RESS_TYPE_ED25519_ACCOUNT\x10\x03\x32\xf2\t\n\x06Wallet\x12I\n\x0c\x43reateWallet\x12\x1b.pactus.CreateWalletRequest\x1a\x1c.pactus.CreateWalletResponse\x12L\n\rRestoreWallet\x12\x1c.pactus.RestoreWalletRequest\x1a\x1d.pactus.RestoreWalletResponse\x12\x43\n\nLoadWallet\x12\x19.pactus.LoadWalletRequest\x1a\x1a.pactus.LoadWalletResponse\x12I\n\x0cUnloadWallet\x12\x1b.pactus.UnloadWalletRequest\x1a\x1c.pactus.UnloadWalletResponse\x12R\n\x0fGetTotalBalance\x12\x1e.pactus.GetTotalBalanceRequest\x1a\x1f.pactus.GetTotalBalanceResponse\x12[\n\x12SignRawTransaction\x12!.pactus.SignRawTransactionRequest\x1a\".pactus.SignRawTransactionResponse\x12^\n\x13GetValidatorAddress\x12\".pactus.GetValidatorAddressRequest\x1a#.pactus.GetValidatorAddressResponse\x12L\n\rGetNewAddress\x12\x1c.pactus.GetNewAddressRequest\x1a\x1d.pactus.GetNewAddressResponse\x12X\n\x11GetAddressHistory\x12 .pactus.GetAddressHistoryRequest\x1a!.pactus.GetAddressHistoryResponse\x12\x46\n\x0bSignMessage\x12\x1a.pactus.SignMessageRequest\x1a\x1b.pactus.SignMessageResponse\x12L\n\rGetTotalStake\x12\x1c.pactus.GetTotalStakeRequest\x1a\x1d.pactus.GetTotalStakeResponse\x12O\n\x0eGetAddressInfo\x12\x1d.pactus.GetAddressInfoRequest\x1a\x1e.pactus.GetAddressInfoResponse\x12\x44\n\x0fSetAddressLabel\x12\x17.pactus.SetLabelRequest\x1a\x18.pactus.SetLabelResponse\x12\x43\n\nListWallet\x12\x19.pactus.ListWalletRequest\x1a\x1a.pactus.ListWalletResponse\x12L\n\rGetWalletInfo\x12\x1c.pactus.GetWalletInfoRequest\x1a\x1d.pactus.GetWalletInfoResponse\x12\x46\n\x0bListAddress\x12\x1a.pactus.ListAddressRequest\x1a\x1b.pactus.ListAddressResponseBA\n\rpactus.walletZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "wallet_pb2", globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'wallet_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = ( - b"\n\rpactus.walletZ0github.com/pactus-project/pactus/www/grpc/pactus" - ) - _ADDRESSTYPE._serialized_start = 1994 - _ADDRESSTYPE._serialized_end = 2092 - _ADDRESSINFO._serialized_start = 43 - _ADDRESSINFO._serialized_end = 155 - _HISTORYINFO._serialized_start = 158 - _HISTORYINFO._serialized_end = 323 - _GETADDRESSHISTORYREQUEST._serialized_start = 325 - _GETADDRESSHISTORYREQUEST._serialized_end = 410 - _GETADDRESSHISTORYRESPONSE._serialized_start = 412 - _GETADDRESSHISTORYRESPONSE._serialized_end = 495 - _GETNEWADDRESSREQUEST._serialized_start = 498 - _GETNEWADDRESSREQUEST._serialized_end = 631 - _GETNEWADDRESSRESPONSE._serialized_start = 633 - _GETNEWADDRESSRESPONSE._serialized_end = 745 - _RESTOREWALLETREQUEST._serialized_start = 747 - _RESTOREWALLETREQUEST._serialized_end = 858 - _RESTOREWALLETRESPONSE._serialized_start = 860 - _RESTOREWALLETRESPONSE._serialized_end = 916 - _CREATEWALLETREQUEST._serialized_start = 918 - _CREATEWALLETREQUEST._serialized_end = 1000 - _CREATEWALLETRESPONSE._serialized_start = 1002 - _CREATEWALLETRESPONSE._serialized_end = 1052 - _LOADWALLETREQUEST._serialized_start = 1054 - _LOADWALLETREQUEST._serialized_end = 1106 - _LOADWALLETRESPONSE._serialized_start = 1108 - _LOADWALLETRESPONSE._serialized_end = 1161 - _UNLOADWALLETREQUEST._serialized_start = 1163 - _UNLOADWALLETREQUEST._serialized_end = 1217 - _UNLOADWALLETRESPONSE._serialized_start = 1219 - _UNLOADWALLETRESPONSE._serialized_end = 1274 - _GETVALIDATORADDRESSREQUEST._serialized_start = 1276 - _GETVALIDATORADDRESSREQUEST._serialized_end = 1335 - _GETVALIDATORADDRESSRESPONSE._serialized_start = 1337 - _GETVALIDATORADDRESSRESPONSE._serialized_end = 1392 - _SIGNRAWTRANSACTIONREQUEST._serialized_start = 1395 - _SIGNRAWTRANSACTIONREQUEST._serialized_end = 1524 - _SIGNRAWTRANSACTIONRESPONSE._serialized_start = 1526 - _SIGNRAWTRANSACTIONRESPONSE._serialized_end = 1647 - _GETTOTALBALANCEREQUEST._serialized_start = 1649 - _GETTOTALBALANCEREQUEST._serialized_end = 1706 - _GETTOTALBALANCERESPONSE._serialized_start = 1708 - _GETTOTALBALANCERESPONSE._serialized_end = 1803 - _SIGNMESSAGEREQUEST._serialized_start = 1806 - _SIGNMESSAGEREQUEST._serialized_end = 1939 - _SIGNMESSAGERESPONSE._serialized_start = 1941 - _SIGNMESSAGERESPONSE._serialized_end = 1992 - _WALLET._serialized_start = 2095 - _WALLET._serialized_end = 2913 + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\rpactus.walletZ0github.com/pactus-project/pactus/www/grpc/pactus' + _ADDRESSTYPE._serialized_start=2999 + _ADDRESSTYPE._serialized_end=3131 + _ADDRESSINFO._serialized_start=43 + _ADDRESSINFO._serialized_end=155 + _HISTORYINFO._serialized_start=158 + _HISTORYINFO._serialized_end=323 + _GETADDRESSHISTORYREQUEST._serialized_start=325 + _GETADDRESSHISTORYREQUEST._serialized_end=410 + _GETADDRESSHISTORYRESPONSE._serialized_start=412 + _GETADDRESSHISTORYRESPONSE._serialized_end=495 + _GETNEWADDRESSREQUEST._serialized_start=498 + _GETNEWADDRESSREQUEST._serialized_end=659 + _GETNEWADDRESSRESPONSE._serialized_start=661 + _GETNEWADDRESSRESPONSE._serialized_end=773 + _RESTOREWALLETREQUEST._serialized_start=775 + _RESTOREWALLETREQUEST._serialized_end=886 + _RESTOREWALLETRESPONSE._serialized_start=888 + _RESTOREWALLETRESPONSE._serialized_end=944 + _CREATEWALLETREQUEST._serialized_start=946 + _CREATEWALLETREQUEST._serialized_end=1028 + _CREATEWALLETRESPONSE._serialized_start=1030 + _CREATEWALLETRESPONSE._serialized_end=1080 + _LOADWALLETREQUEST._serialized_start=1082 + _LOADWALLETREQUEST._serialized_end=1134 + _LOADWALLETRESPONSE._serialized_start=1136 + _LOADWALLETRESPONSE._serialized_end=1189 + _UNLOADWALLETREQUEST._serialized_start=1191 + _UNLOADWALLETREQUEST._serialized_end=1245 + _UNLOADWALLETRESPONSE._serialized_start=1247 + _UNLOADWALLETRESPONSE._serialized_end=1302 + _GETVALIDATORADDRESSREQUEST._serialized_start=1304 + _GETVALIDATORADDRESSREQUEST._serialized_end=1363 + _GETVALIDATORADDRESSRESPONSE._serialized_start=1365 + _GETVALIDATORADDRESSRESPONSE._serialized_end=1420 + _SIGNRAWTRANSACTIONREQUEST._serialized_start=1423 + _SIGNRAWTRANSACTIONREQUEST._serialized_end=1552 + _SIGNRAWTRANSACTIONRESPONSE._serialized_start=1554 + _SIGNRAWTRANSACTIONRESPONSE._serialized_end=1675 + _GETTOTALBALANCEREQUEST._serialized_start=1677 + _GETTOTALBALANCEREQUEST._serialized_end=1734 + _GETTOTALBALANCERESPONSE._serialized_start=1736 + _GETTOTALBALANCERESPONSE._serialized_end=1831 + _SIGNMESSAGEREQUEST._serialized_start=1834 + _SIGNMESSAGEREQUEST._serialized_end=1967 + _SIGNMESSAGERESPONSE._serialized_start=1969 + _SIGNMESSAGERESPONSE._serialized_end=2020 + _GETTOTALSTAKEREQUEST._serialized_start=2022 + _GETTOTALSTAKEREQUEST._serialized_end=2077 + _GETTOTALSTAKERESPONSE._serialized_start=2079 + _GETTOTALSTAKERESPONSE._serialized_end=2168 + _GETADDRESSINFOREQUEST._serialized_start=2170 + _GETADDRESSINFOREQUEST._serialized_end=2252 + _GETADDRESSINFORESPONSE._serialized_start=2255 + _GETADDRESSINFORESPONSE._serialized_end=2411 + _SETLABELREQUEST._serialized_start=2413 + _SETLABELREQUEST._serialized_end=2539 + _SETLABELRESPONSE._serialized_start=2541 + _SETLABELRESPONSE._serialized_end=2559 + _LISTWALLETREQUEST._serialized_start=2561 + _LISTWALLETREQUEST._serialized_end=2580 + _LISTWALLETRESPONSE._serialized_start=2582 + _LISTWALLETRESPONSE._serialized_end=2628 + _GETWALLETINFOREQUEST._serialized_start=2630 + _GETWALLETINFOREQUEST._serialized_end=2685 + _GETWALLETINFORESPONSE._serialized_start=2688 + _GETWALLETINFORESPONSE._serialized_end=2877 + _LISTADDRESSREQUEST._serialized_start=2879 + _LISTADDRESSREQUEST._serialized_end=2932 + _LISTADDRESSRESPONSE._serialized_start=2934 + _LISTADDRESSRESPONSE._serialized_end=2996 + _WALLET._serialized_start=3134 + _WALLET._serialized_end=4400 # @@protoc_insertion_point(module_scope) diff --git a/pactus/rpc/wallet_pb2.pyi b/pactus/rpc/wallet_pb2.pyi index f6073b8..e74382a 100644 --- a/pactus/rpc/wallet_pb2.pyi +++ b/pactus/rpc/wallet_pb2.pyi @@ -3,13 +3,7 @@ from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor @@ -18,10 +12,11 @@ class AddressType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): ADDRESS_TYPE_TREASURY: _ClassVar[AddressType] ADDRESS_TYPE_VALIDATOR: _ClassVar[AddressType] ADDRESS_TYPE_BLS_ACCOUNT: _ClassVar[AddressType] - + ADDRESS_TYPE_ED25519_ACCOUNT: _ClassVar[AddressType] ADDRESS_TYPE_TREASURY: AddressType ADDRESS_TYPE_VALIDATOR: AddressType ADDRESS_TYPE_BLS_ACCOUNT: AddressType +ADDRESS_TYPE_ED25519_ACCOUNT: AddressType class AddressInfo(_message.Message): __slots__ = ("address", "public_key", "label", "path") @@ -33,13 +28,7 @@ class AddressInfo(_message.Message): public_key: str label: str path: str - def __init__( - self, - address: _Optional[str] = ..., - public_key: _Optional[str] = ..., - label: _Optional[str] = ..., - path: _Optional[str] = ..., - ) -> None: ... + def __init__(self, address: _Optional[str] = ..., public_key: _Optional[str] = ..., label: _Optional[str] = ..., path: _Optional[str] = ...) -> None: ... class HistoryInfo(_message.Message): __slots__ = ("transaction_id", "time", "payload_type", "description", "amount") @@ -53,14 +42,7 @@ class HistoryInfo(_message.Message): payload_type: str description: str amount: int - def __init__( - self, - transaction_id: _Optional[str] = ..., - time: _Optional[int] = ..., - payload_type: _Optional[str] = ..., - description: _Optional[str] = ..., - amount: _Optional[int] = ..., - ) -> None: ... + def __init__(self, transaction_id: _Optional[str] = ..., time: _Optional[int] = ..., payload_type: _Optional[str] = ..., description: _Optional[str] = ..., amount: _Optional[int] = ...) -> None: ... class GetAddressHistoryRequest(_message.Message): __slots__ = ("wallet_name", "address") @@ -68,32 +50,25 @@ class GetAddressHistoryRequest(_message.Message): ADDRESS_FIELD_NUMBER: _ClassVar[int] wallet_name: str address: str - def __init__( - self, wallet_name: _Optional[str] = ..., address: _Optional[str] = ... - ) -> None: ... + def __init__(self, wallet_name: _Optional[str] = ..., address: _Optional[str] = ...) -> None: ... class GetAddressHistoryResponse(_message.Message): __slots__ = ("history_info",) HISTORY_INFO_FIELD_NUMBER: _ClassVar[int] history_info: _containers.RepeatedCompositeFieldContainer[HistoryInfo] - def __init__( - self, history_info: _Optional[_Iterable[_Union[HistoryInfo, _Mapping]]] = ... - ) -> None: ... + def __init__(self, history_info: _Optional[_Iterable[_Union[HistoryInfo, _Mapping]]] = ...) -> None: ... class GetNewAddressRequest(_message.Message): - __slots__ = ("wallet_name", "address_type", "label") + __slots__ = ("wallet_name", "address_type", "label", "password") WALLET_NAME_FIELD_NUMBER: _ClassVar[int] ADDRESS_TYPE_FIELD_NUMBER: _ClassVar[int] LABEL_FIELD_NUMBER: _ClassVar[int] + PASSWORD_FIELD_NUMBER: _ClassVar[int] wallet_name: str address_type: AddressType label: str - def __init__( - self, - wallet_name: _Optional[str] = ..., - address_type: _Optional[_Union[AddressType, str]] = ..., - label: _Optional[str] = ..., - ) -> None: ... + password: str + def __init__(self, wallet_name: _Optional[str] = ..., address_type: _Optional[_Union[AddressType, str]] = ..., label: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... class GetNewAddressResponse(_message.Message): __slots__ = ("wallet_name", "address_info") @@ -101,11 +76,7 @@ class GetNewAddressResponse(_message.Message): ADDRESS_INFO_FIELD_NUMBER: _ClassVar[int] wallet_name: str address_info: AddressInfo - def __init__( - self, - wallet_name: _Optional[str] = ..., - address_info: _Optional[_Union[AddressInfo, _Mapping]] = ..., - ) -> None: ... + def __init__(self, wallet_name: _Optional[str] = ..., address_info: _Optional[_Union[AddressInfo, _Mapping]] = ...) -> None: ... class RestoreWalletRequest(_message.Message): __slots__ = ("wallet_name", "mnemonic", "password") @@ -115,12 +86,7 @@ class RestoreWalletRequest(_message.Message): wallet_name: str mnemonic: str password: str - def __init__( - self, - wallet_name: _Optional[str] = ..., - mnemonic: _Optional[str] = ..., - password: _Optional[str] = ..., - ) -> None: ... + def __init__(self, wallet_name: _Optional[str] = ..., mnemonic: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... class RestoreWalletResponse(_message.Message): __slots__ = ("wallet_name",) @@ -134,9 +100,7 @@ class CreateWalletRequest(_message.Message): PASSWORD_FIELD_NUMBER: _ClassVar[int] wallet_name: str password: str - def __init__( - self, wallet_name: _Optional[str] = ..., password: _Optional[str] = ... - ) -> None: ... + def __init__(self, wallet_name: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... class CreateWalletResponse(_message.Message): __slots__ = ("mnemonic",) @@ -188,12 +152,7 @@ class SignRawTransactionRequest(_message.Message): wallet_name: str raw_transaction: str password: str - def __init__( - self, - wallet_name: _Optional[str] = ..., - raw_transaction: _Optional[str] = ..., - password: _Optional[str] = ..., - ) -> None: ... + def __init__(self, wallet_name: _Optional[str] = ..., raw_transaction: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... class SignRawTransactionResponse(_message.Message): __slots__ = ("transaction_id", "signed_raw_transaction") @@ -201,11 +160,7 @@ class SignRawTransactionResponse(_message.Message): SIGNED_RAW_TRANSACTION_FIELD_NUMBER: _ClassVar[int] transaction_id: str signed_raw_transaction: str - def __init__( - self, - transaction_id: _Optional[str] = ..., - signed_raw_transaction: _Optional[str] = ..., - ) -> None: ... + def __init__(self, transaction_id: _Optional[str] = ..., signed_raw_transaction: _Optional[str] = ...) -> None: ... class GetTotalBalanceRequest(_message.Message): __slots__ = ("wallet_name",) @@ -219,9 +174,7 @@ class GetTotalBalanceResponse(_message.Message): TOTAL_BALANCE_FIELD_NUMBER: _ClassVar[int] wallet_name: str total_balance: int - def __init__( - self, wallet_name: _Optional[str] = ..., total_balance: _Optional[int] = ... - ) -> None: ... + def __init__(self, wallet_name: _Optional[str] = ..., total_balance: _Optional[int] = ...) -> None: ... class SignMessageRequest(_message.Message): __slots__ = ("wallet_name", "password", "address", "message") @@ -233,16 +186,106 @@ class SignMessageRequest(_message.Message): password: str address: str message: str - def __init__( - self, - wallet_name: _Optional[str] = ..., - password: _Optional[str] = ..., - address: _Optional[str] = ..., - message: _Optional[str] = ..., - ) -> None: ... + def __init__(self, wallet_name: _Optional[str] = ..., password: _Optional[str] = ..., address: _Optional[str] = ..., message: _Optional[str] = ...) -> None: ... class SignMessageResponse(_message.Message): __slots__ = ("signature",) SIGNATURE_FIELD_NUMBER: _ClassVar[int] signature: str def __init__(self, signature: _Optional[str] = ...) -> None: ... + +class GetTotalStakeRequest(_message.Message): + __slots__ = ("wallet_name",) + WALLET_NAME_FIELD_NUMBER: _ClassVar[int] + wallet_name: str + def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... + +class GetTotalStakeResponse(_message.Message): + __slots__ = ("total_stake", "wallet_name") + TOTAL_STAKE_FIELD_NUMBER: _ClassVar[int] + WALLET_NAME_FIELD_NUMBER: _ClassVar[int] + total_stake: int + wallet_name: str + def __init__(self, total_stake: _Optional[int] = ..., wallet_name: _Optional[str] = ...) -> None: ... + +class GetAddressInfoRequest(_message.Message): + __slots__ = ("wallet_name", "address") + WALLET_NAME_FIELD_NUMBER: _ClassVar[int] + ADDRESS_FIELD_NUMBER: _ClassVar[int] + wallet_name: str + address: str + def __init__(self, wallet_name: _Optional[str] = ..., address: _Optional[str] = ...) -> None: ... + +class GetAddressInfoResponse(_message.Message): + __slots__ = ("address", "label", "public_key", "path", "wallet_name") + ADDRESS_FIELD_NUMBER: _ClassVar[int] + LABEL_FIELD_NUMBER: _ClassVar[int] + PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] + PATH_FIELD_NUMBER: _ClassVar[int] + WALLET_NAME_FIELD_NUMBER: _ClassVar[int] + address: str + label: str + public_key: str + path: str + wallet_name: str + def __init__(self, address: _Optional[str] = ..., label: _Optional[str] = ..., public_key: _Optional[str] = ..., path: _Optional[str] = ..., wallet_name: _Optional[str] = ...) -> None: ... + +class SetLabelRequest(_message.Message): + __slots__ = ("wallet_name", "password", "address", "label") + WALLET_NAME_FIELD_NUMBER: _ClassVar[int] + PASSWORD_FIELD_NUMBER: _ClassVar[int] + ADDRESS_FIELD_NUMBER: _ClassVar[int] + LABEL_FIELD_NUMBER: _ClassVar[int] + wallet_name: str + password: str + address: str + label: str + def __init__(self, wallet_name: _Optional[str] = ..., password: _Optional[str] = ..., address: _Optional[str] = ..., label: _Optional[str] = ...) -> None: ... + +class SetLabelResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class ListWalletRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class ListWalletResponse(_message.Message): + __slots__ = ("wallets",) + WALLETS_FIELD_NUMBER: _ClassVar[int] + wallets: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, wallets: _Optional[_Iterable[str]] = ...) -> None: ... + +class GetWalletInfoRequest(_message.Message): + __slots__ = ("wallet_name",) + WALLET_NAME_FIELD_NUMBER: _ClassVar[int] + wallet_name: str + def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... + +class GetWalletInfoResponse(_message.Message): + __slots__ = ("wallet_name", "version", "network", "encrypted", "uuid", "created_at") + WALLET_NAME_FIELD_NUMBER: _ClassVar[int] + VERSION_FIELD_NUMBER: _ClassVar[int] + NETWORK_FIELD_NUMBER: _ClassVar[int] + ENCRYPTED_FIELD_NUMBER: _ClassVar[int] + UUID_FIELD_NUMBER: _ClassVar[int] + CREATED_AT_FIELD_NUMBER: _ClassVar[int] + wallet_name: str + version: int + network: str + encrypted: bool + uuid: str + created_at: int + def __init__(self, wallet_name: _Optional[str] = ..., version: _Optional[int] = ..., network: _Optional[str] = ..., encrypted: bool = ..., uuid: _Optional[str] = ..., created_at: _Optional[int] = ...) -> None: ... + +class ListAddressRequest(_message.Message): + __slots__ = ("wallet_name",) + WALLET_NAME_FIELD_NUMBER: _ClassVar[int] + wallet_name: str + def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... + +class ListAddressResponse(_message.Message): + __slots__ = ("data",) + DATA_FIELD_NUMBER: _ClassVar[int] + data: _containers.RepeatedCompositeFieldContainer[AddressInfo] + def __init__(self, data: _Optional[_Iterable[_Union[AddressInfo, _Mapping]]] = ...) -> None: ... diff --git a/pactus/rpc/wallet_pb2_grpc.py b/pactus/rpc/wallet_pb2_grpc.py index 115b3f7..5f3c9bd 100644 --- a/pactus/rpc/wallet_pb2_grpc.py +++ b/pactus/rpc/wallet_pb2_grpc.py @@ -1,13 +1,13 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" - import grpc from . import wallet_pb2 as wallet__pb2 class WalletStub(object): - """Define the Wallet service with various RPC methods for wallet management.""" + """Define the Wallet service with various RPC methods for wallet management. + """ def __init__(self, channel): """Constructor. @@ -16,472 +16,566 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.CreateWallet = channel.unary_unary( - "/pactus.Wallet/CreateWallet", - request_serializer=wallet__pb2.CreateWalletRequest.SerializeToString, - response_deserializer=wallet__pb2.CreateWalletResponse.FromString, - ) + '/pactus.Wallet/CreateWallet', + request_serializer=wallet__pb2.CreateWalletRequest.SerializeToString, + response_deserializer=wallet__pb2.CreateWalletResponse.FromString, + ) self.RestoreWallet = channel.unary_unary( - "/pactus.Wallet/RestoreWallet", - request_serializer=wallet__pb2.RestoreWalletRequest.SerializeToString, - response_deserializer=wallet__pb2.RestoreWalletResponse.FromString, - ) + '/pactus.Wallet/RestoreWallet', + request_serializer=wallet__pb2.RestoreWalletRequest.SerializeToString, + response_deserializer=wallet__pb2.RestoreWalletResponse.FromString, + ) self.LoadWallet = channel.unary_unary( - "/pactus.Wallet/LoadWallet", - request_serializer=wallet__pb2.LoadWalletRequest.SerializeToString, - response_deserializer=wallet__pb2.LoadWalletResponse.FromString, - ) + '/pactus.Wallet/LoadWallet', + request_serializer=wallet__pb2.LoadWalletRequest.SerializeToString, + response_deserializer=wallet__pb2.LoadWalletResponse.FromString, + ) self.UnloadWallet = channel.unary_unary( - "/pactus.Wallet/UnloadWallet", - request_serializer=wallet__pb2.UnloadWalletRequest.SerializeToString, - response_deserializer=wallet__pb2.UnloadWalletResponse.FromString, - ) + '/pactus.Wallet/UnloadWallet', + request_serializer=wallet__pb2.UnloadWalletRequest.SerializeToString, + response_deserializer=wallet__pb2.UnloadWalletResponse.FromString, + ) self.GetTotalBalance = channel.unary_unary( - "/pactus.Wallet/GetTotalBalance", - request_serializer=wallet__pb2.GetTotalBalanceRequest.SerializeToString, - response_deserializer=wallet__pb2.GetTotalBalanceResponse.FromString, - ) + '/pactus.Wallet/GetTotalBalance', + request_serializer=wallet__pb2.GetTotalBalanceRequest.SerializeToString, + response_deserializer=wallet__pb2.GetTotalBalanceResponse.FromString, + ) self.SignRawTransaction = channel.unary_unary( - "/pactus.Wallet/SignRawTransaction", - request_serializer=wallet__pb2.SignRawTransactionRequest.SerializeToString, - response_deserializer=wallet__pb2.SignRawTransactionResponse.FromString, - ) + '/pactus.Wallet/SignRawTransaction', + request_serializer=wallet__pb2.SignRawTransactionRequest.SerializeToString, + response_deserializer=wallet__pb2.SignRawTransactionResponse.FromString, + ) self.GetValidatorAddress = channel.unary_unary( - "/pactus.Wallet/GetValidatorAddress", - request_serializer=wallet__pb2.GetValidatorAddressRequest.SerializeToString, - response_deserializer=wallet__pb2.GetValidatorAddressResponse.FromString, - ) + '/pactus.Wallet/GetValidatorAddress', + request_serializer=wallet__pb2.GetValidatorAddressRequest.SerializeToString, + response_deserializer=wallet__pb2.GetValidatorAddressResponse.FromString, + ) self.GetNewAddress = channel.unary_unary( - "/pactus.Wallet/GetNewAddress", - request_serializer=wallet__pb2.GetNewAddressRequest.SerializeToString, - response_deserializer=wallet__pb2.GetNewAddressResponse.FromString, - ) + '/pactus.Wallet/GetNewAddress', + request_serializer=wallet__pb2.GetNewAddressRequest.SerializeToString, + response_deserializer=wallet__pb2.GetNewAddressResponse.FromString, + ) self.GetAddressHistory = channel.unary_unary( - "/pactus.Wallet/GetAddressHistory", - request_serializer=wallet__pb2.GetAddressHistoryRequest.SerializeToString, - response_deserializer=wallet__pb2.GetAddressHistoryResponse.FromString, - ) + '/pactus.Wallet/GetAddressHistory', + request_serializer=wallet__pb2.GetAddressHistoryRequest.SerializeToString, + response_deserializer=wallet__pb2.GetAddressHistoryResponse.FromString, + ) self.SignMessage = channel.unary_unary( - "/pactus.Wallet/SignMessage", - request_serializer=wallet__pb2.SignMessageRequest.SerializeToString, - response_deserializer=wallet__pb2.SignMessageResponse.FromString, - ) + '/pactus.Wallet/SignMessage', + request_serializer=wallet__pb2.SignMessageRequest.SerializeToString, + response_deserializer=wallet__pb2.SignMessageResponse.FromString, + ) + self.GetTotalStake = channel.unary_unary( + '/pactus.Wallet/GetTotalStake', + request_serializer=wallet__pb2.GetTotalStakeRequest.SerializeToString, + response_deserializer=wallet__pb2.GetTotalStakeResponse.FromString, + ) + self.GetAddressInfo = channel.unary_unary( + '/pactus.Wallet/GetAddressInfo', + request_serializer=wallet__pb2.GetAddressInfoRequest.SerializeToString, + response_deserializer=wallet__pb2.GetAddressInfoResponse.FromString, + ) + self.SetAddressLabel = channel.unary_unary( + '/pactus.Wallet/SetAddressLabel', + request_serializer=wallet__pb2.SetLabelRequest.SerializeToString, + response_deserializer=wallet__pb2.SetLabelResponse.FromString, + ) + self.ListWallet = channel.unary_unary( + '/pactus.Wallet/ListWallet', + request_serializer=wallet__pb2.ListWalletRequest.SerializeToString, + response_deserializer=wallet__pb2.ListWalletResponse.FromString, + ) + self.GetWalletInfo = channel.unary_unary( + '/pactus.Wallet/GetWalletInfo', + request_serializer=wallet__pb2.GetWalletInfoRequest.SerializeToString, + response_deserializer=wallet__pb2.GetWalletInfoResponse.FromString, + ) + self.ListAddress = channel.unary_unary( + '/pactus.Wallet/ListAddress', + request_serializer=wallet__pb2.ListAddressRequest.SerializeToString, + response_deserializer=wallet__pb2.ListAddressResponse.FromString, + ) class WalletServicer(object): - """Define the Wallet service with various RPC methods for wallet management.""" + """Define the Wallet service with various RPC methods for wallet management. + """ def CreateWallet(self, request, context): - """CreateWallet creates a new wallet with the specified parameters.""" + """CreateWallet creates a new wallet with the specified parameters. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def RestoreWallet(self, request, context): - """RestoreWallet restores an existing wallet with the given mnemonic.""" + """RestoreWallet restores an existing wallet with the given mnemonic. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def LoadWallet(self, request, context): - """LoadWallet loads an existing wallet with the given name.""" + """LoadWallet loads an existing wallet with the given name. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def UnloadWallet(self, request, context): - """UnloadWallet unloads a currently loaded wallet with the specified name.""" + """UnloadWallet unloads a currently loaded wallet with the specified name. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetTotalBalance(self, request, context): - """GetTotalBalance returns the total available balance of the wallet.""" + """GetTotalBalance returns the total available balance of the wallet. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def SignRawTransaction(self, request, context): - """SignRawTransaction signs a raw transaction for a specified wallet.""" + """SignRawTransaction signs a raw transaction for a specified wallet. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetValidatorAddress(self, request, context): """GetValidatorAddress retrieves the validator address associated with a public key. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetNewAddress(self, request, context): - """GetNewAddress generates a new address for the specified wallet.""" + """GetNewAddress generates a new address for the specified wallet. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetAddressHistory(self, request, context): - """GetAddressHistory retrieves the transaction history of an address.""" + """GetAddressHistory retrieves the transaction history of an address. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def SignMessage(self, request, context): - """SignMessage signs an arbitrary message.""" + """SignMessage signs an arbitrary message. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetTotalStake(self, request, context): + """GetTotalStake return total stake of wallet. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetAddressInfo(self, request, context): + """GetAddressInfo return address information. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetAddressLabel(self, request, context): + """SetAddressLabel set label for given address. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListWallet(self, request, context): + """ListWallet return list wallet name. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetWalletInfo(self, request, context): + """GetWalletInfo return wallet information. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListAddress(self, request, context): + """ListAddress return list address in wallet. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_WalletServicer_to_server(servicer, server): rpc_method_handlers = { - "CreateWallet": grpc.unary_unary_rpc_method_handler( - servicer.CreateWallet, - request_deserializer=wallet__pb2.CreateWalletRequest.FromString, - response_serializer=wallet__pb2.CreateWalletResponse.SerializeToString, - ), - "RestoreWallet": grpc.unary_unary_rpc_method_handler( - servicer.RestoreWallet, - request_deserializer=wallet__pb2.RestoreWalletRequest.FromString, - response_serializer=wallet__pb2.RestoreWalletResponse.SerializeToString, - ), - "LoadWallet": grpc.unary_unary_rpc_method_handler( - servicer.LoadWallet, - request_deserializer=wallet__pb2.LoadWalletRequest.FromString, - response_serializer=wallet__pb2.LoadWalletResponse.SerializeToString, - ), - "UnloadWallet": grpc.unary_unary_rpc_method_handler( - servicer.UnloadWallet, - request_deserializer=wallet__pb2.UnloadWalletRequest.FromString, - response_serializer=wallet__pb2.UnloadWalletResponse.SerializeToString, - ), - "GetTotalBalance": grpc.unary_unary_rpc_method_handler( - servicer.GetTotalBalance, - request_deserializer=wallet__pb2.GetTotalBalanceRequest.FromString, - response_serializer=wallet__pb2.GetTotalBalanceResponse.SerializeToString, - ), - "SignRawTransaction": grpc.unary_unary_rpc_method_handler( - servicer.SignRawTransaction, - request_deserializer=wallet__pb2.SignRawTransactionRequest.FromString, - response_serializer=wallet__pb2.SignRawTransactionResponse.SerializeToString, - ), - "GetValidatorAddress": grpc.unary_unary_rpc_method_handler( - servicer.GetValidatorAddress, - request_deserializer=wallet__pb2.GetValidatorAddressRequest.FromString, - response_serializer=wallet__pb2.GetValidatorAddressResponse.SerializeToString, - ), - "GetNewAddress": grpc.unary_unary_rpc_method_handler( - servicer.GetNewAddress, - request_deserializer=wallet__pb2.GetNewAddressRequest.FromString, - response_serializer=wallet__pb2.GetNewAddressResponse.SerializeToString, - ), - "GetAddressHistory": grpc.unary_unary_rpc_method_handler( - servicer.GetAddressHistory, - request_deserializer=wallet__pb2.GetAddressHistoryRequest.FromString, - response_serializer=wallet__pb2.GetAddressHistoryResponse.SerializeToString, - ), - "SignMessage": grpc.unary_unary_rpc_method_handler( - servicer.SignMessage, - request_deserializer=wallet__pb2.SignMessageRequest.FromString, - response_serializer=wallet__pb2.SignMessageResponse.SerializeToString, - ), + 'CreateWallet': grpc.unary_unary_rpc_method_handler( + servicer.CreateWallet, + request_deserializer=wallet__pb2.CreateWalletRequest.FromString, + response_serializer=wallet__pb2.CreateWalletResponse.SerializeToString, + ), + 'RestoreWallet': grpc.unary_unary_rpc_method_handler( + servicer.RestoreWallet, + request_deserializer=wallet__pb2.RestoreWalletRequest.FromString, + response_serializer=wallet__pb2.RestoreWalletResponse.SerializeToString, + ), + 'LoadWallet': grpc.unary_unary_rpc_method_handler( + servicer.LoadWallet, + request_deserializer=wallet__pb2.LoadWalletRequest.FromString, + response_serializer=wallet__pb2.LoadWalletResponse.SerializeToString, + ), + 'UnloadWallet': grpc.unary_unary_rpc_method_handler( + servicer.UnloadWallet, + request_deserializer=wallet__pb2.UnloadWalletRequest.FromString, + response_serializer=wallet__pb2.UnloadWalletResponse.SerializeToString, + ), + 'GetTotalBalance': grpc.unary_unary_rpc_method_handler( + servicer.GetTotalBalance, + request_deserializer=wallet__pb2.GetTotalBalanceRequest.FromString, + response_serializer=wallet__pb2.GetTotalBalanceResponse.SerializeToString, + ), + 'SignRawTransaction': grpc.unary_unary_rpc_method_handler( + servicer.SignRawTransaction, + request_deserializer=wallet__pb2.SignRawTransactionRequest.FromString, + response_serializer=wallet__pb2.SignRawTransactionResponse.SerializeToString, + ), + 'GetValidatorAddress': grpc.unary_unary_rpc_method_handler( + servicer.GetValidatorAddress, + request_deserializer=wallet__pb2.GetValidatorAddressRequest.FromString, + response_serializer=wallet__pb2.GetValidatorAddressResponse.SerializeToString, + ), + 'GetNewAddress': grpc.unary_unary_rpc_method_handler( + servicer.GetNewAddress, + request_deserializer=wallet__pb2.GetNewAddressRequest.FromString, + response_serializer=wallet__pb2.GetNewAddressResponse.SerializeToString, + ), + 'GetAddressHistory': grpc.unary_unary_rpc_method_handler( + servicer.GetAddressHistory, + request_deserializer=wallet__pb2.GetAddressHistoryRequest.FromString, + response_serializer=wallet__pb2.GetAddressHistoryResponse.SerializeToString, + ), + 'SignMessage': grpc.unary_unary_rpc_method_handler( + servicer.SignMessage, + request_deserializer=wallet__pb2.SignMessageRequest.FromString, + response_serializer=wallet__pb2.SignMessageResponse.SerializeToString, + ), + 'GetTotalStake': grpc.unary_unary_rpc_method_handler( + servicer.GetTotalStake, + request_deserializer=wallet__pb2.GetTotalStakeRequest.FromString, + response_serializer=wallet__pb2.GetTotalStakeResponse.SerializeToString, + ), + 'GetAddressInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetAddressInfo, + request_deserializer=wallet__pb2.GetAddressInfoRequest.FromString, + response_serializer=wallet__pb2.GetAddressInfoResponse.SerializeToString, + ), + 'SetAddressLabel': grpc.unary_unary_rpc_method_handler( + servicer.SetAddressLabel, + request_deserializer=wallet__pb2.SetLabelRequest.FromString, + response_serializer=wallet__pb2.SetLabelResponse.SerializeToString, + ), + 'ListWallet': grpc.unary_unary_rpc_method_handler( + servicer.ListWallet, + request_deserializer=wallet__pb2.ListWalletRequest.FromString, + response_serializer=wallet__pb2.ListWalletResponse.SerializeToString, + ), + 'GetWalletInfo': grpc.unary_unary_rpc_method_handler( + servicer.GetWalletInfo, + request_deserializer=wallet__pb2.GetWalletInfoRequest.FromString, + response_serializer=wallet__pb2.GetWalletInfoResponse.SerializeToString, + ), + 'ListAddress': grpc.unary_unary_rpc_method_handler( + servicer.ListAddress, + request_deserializer=wallet__pb2.ListAddressRequest.FromString, + response_serializer=wallet__pb2.ListAddressResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - "pactus.Wallet", rpc_method_handlers - ) + 'pactus.Wallet', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) -# This class is part of an EXPERIMENTAL API. + # This class is part of an EXPERIMENTAL API. class Wallet(object): - """Define the Wallet service with various RPC methods for wallet management.""" + """Define the Wallet service with various RPC methods for wallet management. + """ @staticmethod - def CreateWallet( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def CreateWallet(request, target, - "/pactus.Wallet/CreateWallet", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/CreateWallet', wallet__pb2.CreateWalletRequest.SerializeToString, wallet__pb2.CreateWalletResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def RestoreWallet( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def RestoreWallet(request, target, - "/pactus.Wallet/RestoreWallet", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/RestoreWallet', wallet__pb2.RestoreWalletRequest.SerializeToString, wallet__pb2.RestoreWalletResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def LoadWallet( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def LoadWallet(request, target, - "/pactus.Wallet/LoadWallet", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/LoadWallet', wallet__pb2.LoadWalletRequest.SerializeToString, wallet__pb2.LoadWalletResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def UnloadWallet( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def UnloadWallet(request, target, - "/pactus.Wallet/UnloadWallet", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/UnloadWallet', wallet__pb2.UnloadWalletRequest.SerializeToString, wallet__pb2.UnloadWalletResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetTotalBalance( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetTotalBalance(request, target, - "/pactus.Wallet/GetTotalBalance", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/GetTotalBalance', wallet__pb2.GetTotalBalanceRequest.SerializeToString, wallet__pb2.GetTotalBalanceResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def SignRawTransaction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def SignRawTransaction(request, target, - "/pactus.Wallet/SignRawTransaction", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/SignRawTransaction', wallet__pb2.SignRawTransactionRequest.SerializeToString, wallet__pb2.SignRawTransactionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetValidatorAddress( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetValidatorAddress(request, target, - "/pactus.Wallet/GetValidatorAddress", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/GetValidatorAddress', wallet__pb2.GetValidatorAddressRequest.SerializeToString, wallet__pb2.GetValidatorAddressResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetNewAddress( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetNewAddress(request, target, - "/pactus.Wallet/GetNewAddress", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/GetNewAddress', wallet__pb2.GetNewAddressRequest.SerializeToString, wallet__pb2.GetNewAddressResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetAddressHistory( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetAddressHistory(request, target, - "/pactus.Wallet/GetAddressHistory", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/GetAddressHistory', wallet__pb2.GetAddressHistoryRequest.SerializeToString, wallet__pb2.GetAddressHistoryResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def SignMessage( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def SignMessage(request, target, - "/pactus.Wallet/SignMessage", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/SignMessage', wallet__pb2.SignMessageRequest.SerializeToString, wallet__pb2.SignMessageResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetTotalStake(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/GetTotalStake', + wallet__pb2.GetTotalStakeRequest.SerializeToString, + wallet__pb2.GetTotalStakeResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetAddressInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/GetAddressInfo', + wallet__pb2.GetAddressInfoRequest.SerializeToString, + wallet__pb2.GetAddressInfoResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SetAddressLabel(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/SetAddressLabel', + wallet__pb2.SetLabelRequest.SerializeToString, + wallet__pb2.SetLabelResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ListWallet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/ListWallet', + wallet__pb2.ListWalletRequest.SerializeToString, + wallet__pb2.ListWalletResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetWalletInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/GetWalletInfo', + wallet__pb2.GetWalletInfoRequest.SerializeToString, + wallet__pb2.GetWalletInfoResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ListAddress(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pactus.Wallet/ListAddress', + wallet__pb2.ListAddressRequest.SerializeToString, + wallet__pb2.ListAddressResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pactus/types/amount.py b/pactus/types/amount.py index 84008cd..d7f492d 100644 --- a/pactus/types/amount.py +++ b/pactus/types/amount.py @@ -3,6 +3,7 @@ NANO_PAC_PER_PAC = 1e9 MAX_NANO_PAC = 42e6 * NANO_PAC_PER_PAC + class Amount: """ Amount represents the atomic unit in the Pactus blockchain.