From bea70a7b06cdf4d0f41c667b8053f3e0e9b565cd Mon Sep 17 00:00:00 2001 From: Mostafa Date: Sun, 13 Apr 2025 03:13:25 +0800 Subject: [PATCH 1/3] fix(rpc): use pactus-grpc as rpc dependency --- README.md | 2 +- examples/example_get_blockchain_info.py | 4 +- examples/example_get_consensus_info.py | 4 +- examples/example_get_node_info.py | 4 +- pactus/rpc/__init__.py | 0 pactus/rpc/blockchain_pb2.py | 87 ---- pactus/rpc/blockchain_pb2.pyi | 290 ------------ pactus/rpc/blockchain_pb2_grpc.py | 415 ----------------- pactus/rpc/network_pb2.py | 50 -- pactus/rpc/network_pb2.pyi | 138 ------ pactus/rpc/network_pb2_grpc.py | 104 ----- pactus/rpc/ruff.toml | 5 - pactus/rpc/transaction_pb2.py | 64 --- pactus/rpc/transaction_pb2.pyi | 224 --------- pactus/rpc/transaction_pb2_grpc.py | 279 ------------ pactus/rpc/utils_pb2.py | 42 -- pactus/rpc/utils_pb2.pyi | 62 --- pactus/rpc/utils_pb2_grpc.py | 175 ------- pactus/rpc/wallet_pb2.py | 97 ---- pactus/rpc/wallet_pb2.pyi | 291 ------------ pactus/rpc/wallet_pb2_grpc.py | 581 ------------------------ setup.py | 60 +-- 22 files changed, 31 insertions(+), 2947 deletions(-) delete mode 100644 pactus/rpc/__init__.py delete mode 100644 pactus/rpc/blockchain_pb2.py delete mode 100644 pactus/rpc/blockchain_pb2.pyi delete mode 100644 pactus/rpc/blockchain_pb2_grpc.py delete mode 100644 pactus/rpc/network_pb2.py delete mode 100644 pactus/rpc/network_pb2.pyi delete mode 100644 pactus/rpc/network_pb2_grpc.py delete mode 100644 pactus/rpc/ruff.toml delete mode 100644 pactus/rpc/transaction_pb2.py delete mode 100644 pactus/rpc/transaction_pb2.pyi delete mode 100644 pactus/rpc/transaction_pb2_grpc.py delete mode 100644 pactus/rpc/utils_pb2.py delete mode 100644 pactus/rpc/utils_pb2.pyi delete mode 100644 pactus/rpc/utils_pb2_grpc.py delete mode 100644 pactus/rpc/wallet_pb2.py delete mode 100644 pactus/rpc/wallet_pb2.pyi delete mode 100644 pactus/rpc/wallet_pb2_grpc.py diff --git a/README.md b/README.md index 2200d7a..075687a 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Explore the `examples` folder for more detailed usage scenarios. For local development, you can install the package in editable mode, which allows you to make changes and test them immediately: ```bash -pip install -e . +python3 -m pip install . ``` After making changes, it's important to ensure all tests pass by running: diff --git a/examples/example_get_blockchain_info.py b/examples/example_get_blockchain_info.py index f6d10b9..8f15940 100644 --- a/examples/example_get_blockchain_info.py +++ b/examples/example_get_blockchain_info.py @@ -1,5 +1,5 @@ -from pactus.rpc.blockchain_pb2_grpc import BlockchainStub -from pactus.rpc.blockchain_pb2 import GetBlockchainInfoRequest +from pactus_grpc.blockchain_pb2_grpc import BlockchainStub +from pactus_grpc.blockchain_pb2 import GetBlockchainInfoRequest import grpc diff --git a/examples/example_get_consensus_info.py b/examples/example_get_consensus_info.py index 83366f0..9d5ccd6 100644 --- a/examples/example_get_consensus_info.py +++ b/examples/example_get_consensus_info.py @@ -1,5 +1,5 @@ -from pactus.rpc.blockchain_pb2_grpc import BlockchainStub -from pactus.rpc.blockchain_pb2 import GetConsensusInfoRequest +from pactus_grpc.blockchain_pb2_grpc import BlockchainStub +from pactus_grpc.blockchain_pb2 import GetConsensusInfoRequest import grpc diff --git a/examples/example_get_node_info.py b/examples/example_get_node_info.py index b32420a..7d22d31 100644 --- a/examples/example_get_node_info.py +++ b/examples/example_get_node_info.py @@ -1,5 +1,5 @@ -from pactus.rpc.network_pb2_grpc import NetworkStub -from pactus.rpc.network_pb2 import GetNodeInfoRequest +from pactus_grpc.network_pb2_grpc import NetworkStub +from pactus_grpc.network_pb2 import GetNodeInfoRequest import grpc diff --git a/pactus/rpc/__init__.py b/pactus/rpc/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pactus/rpc/blockchain_pb2.py b/pactus/rpc/blockchain_pb2.py deleted file mode 100644 index 5ca6305..0000000 --- a/pactus/rpc/blockchain_pb2.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- -# 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 -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -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\"\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()) -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=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 deleted file mode 100644 index 97d1615..0000000 --- a/pactus/rpc/blockchain_pb2.pyi +++ /dev/null @@ -1,290 +0,0 @@ -import transaction_pb2 as _transaction_pb2 -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 - -DESCRIPTOR: _descriptor.FileDescriptor - -class BlockVerbosity(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - BLOCK_DATA: _ClassVar[BlockVerbosity] - BLOCK_INFO: _ClassVar[BlockVerbosity] - BLOCK_TRANSACTIONS: _ClassVar[BlockVerbosity] - -class VoteType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - VOTE_UNKNOWN: _ClassVar[VoteType] - VOTE_PREPARE: _ClassVar[VoteType] - VOTE_PRECOMMIT: _ClassVar[VoteType] - VOTE_CHANGE_PROPOSER: _ClassVar[VoteType] -BLOCK_DATA: BlockVerbosity -BLOCK_INFO: BlockVerbosity -BLOCK_TRANSACTIONS: BlockVerbosity -VOTE_UNKNOWN: VoteType -VOTE_PREPARE: VoteType -VOTE_PRECOMMIT: VoteType -VOTE_CHANGE_PROPOSER: VoteType - -class GetAccountRequest(_message.Message): - __slots__ = ("address",) - ADDRESS_FIELD_NUMBER: _ClassVar[int] - address: str - def __init__(self, address: _Optional[str] = ...) -> None: ... - -class GetAccountResponse(_message.Message): - __slots__ = ("account",) - ACCOUNT_FIELD_NUMBER: _ClassVar[int] - account: AccountInfo - def __init__(self, account: _Optional[_Union[AccountInfo, _Mapping]] = ...) -> None: ... - -class GetValidatorAddressesRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class GetValidatorAddressesResponse(_message.Message): - __slots__ = ("addresses",) - ADDRESSES_FIELD_NUMBER: _ClassVar[int] - addresses: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, addresses: _Optional[_Iterable[str]] = ...) -> None: ... - -class GetValidatorRequest(_message.Message): - __slots__ = ("address",) - ADDRESS_FIELD_NUMBER: _ClassVar[int] - address: str - def __init__(self, address: _Optional[str] = ...) -> None: ... - -class GetValidatorByNumberRequest(_message.Message): - __slots__ = ("number",) - NUMBER_FIELD_NUMBER: _ClassVar[int] - number: int - def __init__(self, number: _Optional[int] = ...) -> None: ... - -class GetValidatorResponse(_message.Message): - __slots__ = ("validator",) - VALIDATOR_FIELD_NUMBER: _ClassVar[int] - validator: ValidatorInfo - def __init__(self, validator: _Optional[_Union[ValidatorInfo, _Mapping]] = ...) -> None: ... - -class GetPublicKeyRequest(_message.Message): - __slots__ = ("address",) - ADDRESS_FIELD_NUMBER: _ClassVar[int] - address: str - def __init__(self, address: _Optional[str] = ...) -> None: ... - -class GetPublicKeyResponse(_message.Message): - __slots__ = ("public_key",) - PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] - public_key: str - def __init__(self, public_key: _Optional[str] = ...) -> None: ... - -class GetBlockRequest(_message.Message): - __slots__ = ("height", "verbosity") - HEIGHT_FIELD_NUMBER: _ClassVar[int] - VERBOSITY_FIELD_NUMBER: _ClassVar[int] - height: int - verbosity: BlockVerbosity - 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") - HEIGHT_FIELD_NUMBER: _ClassVar[int] - HASH_FIELD_NUMBER: _ClassVar[int] - DATA_FIELD_NUMBER: _ClassVar[int] - BLOCK_TIME_FIELD_NUMBER: _ClassVar[int] - HEADER_FIELD_NUMBER: _ClassVar[int] - PREV_CERT_FIELD_NUMBER: _ClassVar[int] - TXS_FIELD_NUMBER: _ClassVar[int] - height: int - hash: str - data: str - block_time: int - 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: ... - -class GetBlockHashRequest(_message.Message): - __slots__ = ("height",) - HEIGHT_FIELD_NUMBER: _ClassVar[int] - height: int - def __init__(self, height: _Optional[int] = ...) -> None: ... - -class GetBlockHashResponse(_message.Message): - __slots__ = ("hash",) - HASH_FIELD_NUMBER: _ClassVar[int] - hash: str - def __init__(self, hash: _Optional[str] = ...) -> None: ... - -class GetBlockHeightRequest(_message.Message): - __slots__ = ("hash",) - HASH_FIELD_NUMBER: _ClassVar[int] - hash: str - def __init__(self, hash: _Optional[str] = ...) -> None: ... - -class GetBlockHeightResponse(_message.Message): - __slots__ = ("height",) - HEIGHT_FIELD_NUMBER: _ClassVar[int] - height: int - def __init__(self, height: _Optional[int] = ...) -> None: ... - -class GetBlockchainInfoRequest(_message.Message): - __slots__ = () - 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") - LAST_BLOCK_HEIGHT_FIELD_NUMBER: _ClassVar[int] - LAST_BLOCK_HASH_FIELD_NUMBER: _ClassVar[int] - TOTAL_ACCOUNTS_FIELD_NUMBER: _ClassVar[int] - TOTAL_VALIDATORS_FIELD_NUMBER: _ClassVar[int] - TOTAL_POWER_FIELD_NUMBER: _ClassVar[int] - COMMITTEE_POWER_FIELD_NUMBER: _ClassVar[int] - COMMITTEE_VALIDATORS_FIELD_NUMBER: _ClassVar[int] - IS_PRUNED_FIELD_NUMBER: _ClassVar[int] - PRUNING_HEIGHT_FIELD_NUMBER: _ClassVar[int] - LAST_BLOCK_TIME_FIELD_NUMBER: _ClassVar[int] - last_block_height: int - last_block_hash: str - total_accounts: int - total_validators: int - total_power: int - committee_power: int - committee_validators: _containers.RepeatedCompositeFieldContainer[ValidatorInfo] - 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: ... - -class GetConsensusInfoRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class GetConsensusInfoResponse(_message.Message): - __slots__ = ("proposal", "instances") - PROPOSAL_FIELD_NUMBER: _ClassVar[int] - INSTANCES_FIELD_NUMBER: _ClassVar[int] - proposal: ProposalInfo - instances: _containers.RepeatedCompositeFieldContainer[ConsensusInfo] - 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: ... - -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: ... - -class ValidatorInfo(_message.Message): - __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] - NUMBER_FIELD_NUMBER: _ClassVar[int] - STAKE_FIELD_NUMBER: _ClassVar[int] - LAST_BONDING_HEIGHT_FIELD_NUMBER: _ClassVar[int] - LAST_SORTITION_HEIGHT_FIELD_NUMBER: _ClassVar[int] - UNBONDING_HEIGHT_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FIELD_NUMBER: _ClassVar[int] - AVAILABILITY_SCORE_FIELD_NUMBER: _ClassVar[int] - hash: str - data: str - public_key: str - number: int - stake: int - last_bonding_height: int - last_sortition_height: int - 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: ... - -class AccountInfo(_message.Message): - __slots__ = ("hash", "data", "number", "balance", "address") - HASH_FIELD_NUMBER: _ClassVar[int] - DATA_FIELD_NUMBER: _ClassVar[int] - NUMBER_FIELD_NUMBER: _ClassVar[int] - BALANCE_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FIELD_NUMBER: _ClassVar[int] - hash: str - data: str - 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: ... - -class BlockHeaderInfo(_message.Message): - __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] - SORTITION_SEED_FIELD_NUMBER: _ClassVar[int] - PROPOSER_ADDRESS_FIELD_NUMBER: _ClassVar[int] - version: int - prev_block_hash: str - 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: ... - -class CertificateInfo(_message.Message): - __slots__ = ("hash", "round", "committers", "absentees", "signature") - HASH_FIELD_NUMBER: _ClassVar[int] - ROUND_FIELD_NUMBER: _ClassVar[int] - COMMITTERS_FIELD_NUMBER: _ClassVar[int] - ABSENTEES_FIELD_NUMBER: _ClassVar[int] - SIGNATURE_FIELD_NUMBER: _ClassVar[int] - hash: str - round: int - 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: ... - -class VoteInfo(_message.Message): - __slots__ = ("type", "voter", "block_hash", "round", "cp_round", "cp_value") - TYPE_FIELD_NUMBER: _ClassVar[int] - VOTER_FIELD_NUMBER: _ClassVar[int] - BLOCK_HASH_FIELD_NUMBER: _ClassVar[int] - ROUND_FIELD_NUMBER: _ClassVar[int] - CP_ROUND_FIELD_NUMBER: _ClassVar[int] - CP_VALUE_FIELD_NUMBER: _ClassVar[int] - type: VoteType - voter: str - block_hash: str - 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: ... - -class ConsensusInfo(_message.Message): - __slots__ = ("address", "active", "height", "round", "votes") - ADDRESS_FIELD_NUMBER: _ClassVar[int] - ACTIVE_FIELD_NUMBER: _ClassVar[int] - HEIGHT_FIELD_NUMBER: _ClassVar[int] - ROUND_FIELD_NUMBER: _ClassVar[int] - VOTES_FIELD_NUMBER: _ClassVar[int] - address: str - active: bool - 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: ... - -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 deleted file mode 100644 index e10c16a..0000000 --- a/pactus/rpc/blockchain_pb2_grpc.py +++ /dev/null @@ -1,415 +0,0 @@ -# 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. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GetBlock = channel.unary_unary( - '/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, - ) - self.GetBlockHeight = channel.unary_unary( - '/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, - ) - self.GetConsensusInfo = channel.unary_unary( - '/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, - ) - self.GetValidator = channel.unary_unary( - '/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, - ) - self.GetValidatorAddresses = channel.unary_unary( - '/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, - ) - self.GetTxPoolContent = channel.unary_unary( - '/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. - """ - - 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!') - - def GetBlockHash(self, request, context): - """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!') - - def GetBlockHeight(self, request, context): - """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!') - - def GetBlockchainInfo(self, request, context): - """GetBlockchainInfo retrieves general information about the blockchain. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetConsensusInfo(self, request, context): - """GetConsensusInfo retrieves information about the consensus instances. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - 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!') - - 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!') - - 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!') - - def GetValidatorAddresses(self, request, context): - """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!') - - 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!') - - def GetTxPoolContent(self, request, context): - """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!') - - -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, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'pactus.Blockchain', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Blockchain(object): - """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, target, '/pactus.Blockchain/GetBlock', - blockchain__pb2.GetBlockRequest.SerializeToString, - blockchain__pb2.GetBlockResponse.FromString, - 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, target, '/pactus.Blockchain/GetBlockHash', - blockchain__pb2.GetBlockHashRequest.SerializeToString, - blockchain__pb2.GetBlockHashResponse.FromString, - 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, target, '/pactus.Blockchain/GetBlockHeight', - blockchain__pb2.GetBlockHeightRequest.SerializeToString, - blockchain__pb2.GetBlockHeightResponse.FromString, - 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, target, '/pactus.Blockchain/GetBlockchainInfo', - blockchain__pb2.GetBlockchainInfoRequest.SerializeToString, - blockchain__pb2.GetBlockchainInfoResponse.FromString, - 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, target, '/pactus.Blockchain/GetConsensusInfo', - blockchain__pb2.GetConsensusInfoRequest.SerializeToString, - blockchain__pb2.GetConsensusInfoResponse.FromString, - 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, target, '/pactus.Blockchain/GetAccount', - blockchain__pb2.GetAccountRequest.SerializeToString, - blockchain__pb2.GetAccountResponse.FromString, - 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, target, '/pactus.Blockchain/GetValidator', - blockchain__pb2.GetValidatorRequest.SerializeToString, - blockchain__pb2.GetValidatorResponse.FromString, - 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, target, '/pactus.Blockchain/GetValidatorByNumber', - blockchain__pb2.GetValidatorByNumberRequest.SerializeToString, - blockchain__pb2.GetValidatorResponse.FromString, - 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, target, '/pactus.Blockchain/GetValidatorAddresses', - blockchain__pb2.GetValidatorAddressesRequest.SerializeToString, - blockchain__pb2.GetValidatorAddressesResponse.FromString, - 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, target, '/pactus.Blockchain/GetPublicKey', - blockchain__pb2.GetPublicKeyRequest.SerializeToString, - blockchain__pb2.GetPublicKeyResponse.FromString, - 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, target, '/pactus.Blockchain/GetTxPoolContent', - blockchain__pb2.GetTxPoolContentRequest.SerializeToString, - blockchain__pb2.GetTxPoolContentResponse.FromString, - 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 deleted file mode 100644 index 656347c..0000000 --- a/pactus/rpc/network_pb2.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# 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 -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_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\"\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()) -if _descriptor._USE_C_DESCRIPTORS == False: - - 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 deleted file mode 100644 index 1d199a6..0000000 --- a/pactus/rpc/network_pb2.pyi +++ /dev/null @@ -1,138 +0,0 @@ -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 - -DESCRIPTOR: _descriptor.FileDescriptor - -class GetNetworkInfoRequest(_message.Message): - __slots__ = ("only_connected",) - ONLY_CONNECTED_FIELD_NUMBER: _ClassVar[int] - only_connected: bool - def __init__(self, only_connected: bool = ...) -> None: ... - -class GetNetworkInfoResponse(_message.Message): - __slots__ = ("network_name", "connected_peers_count", "connected_peers", "metric_info") - NETWORK_NAME_FIELD_NUMBER: _ClassVar[int] - CONNECTED_PEERS_COUNT_FIELD_NUMBER: _ClassVar[int] - CONNECTED_PEERS_FIELD_NUMBER: _ClassVar[int] - METRIC_INFO_FIELD_NUMBER: _ClassVar[int] - network_name: str - connected_peers_count: int - connected_peers: _containers.RepeatedCompositeFieldContainer[PeerInfo] - 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") - MONIKER_FIELD_NUMBER: _ClassVar[int] - AGENT_FIELD_NUMBER: _ClassVar[int] - PEER_ID_FIELD_NUMBER: _ClassVar[int] - STARTED_AT_FIELD_NUMBER: _ClassVar[int] - REACHABILITY_FIELD_NUMBER: _ClassVar[int] - SERVICES_FIELD_NUMBER: _ClassVar[int] - SERVICES_NAMES_FIELD_NUMBER: _ClassVar[int] - LOCAL_ADDRS_FIELD_NUMBER: _ClassVar[int] - PROTOCOLS_FIELD_NUMBER: _ClassVar[int] - CLOCK_OFFSET_FIELD_NUMBER: _ClassVar[int] - CONNECTION_INFO_FIELD_NUMBER: _ClassVar[int] - moniker: str - agent: str - peer_id: str - started_at: int - reachability: str - services: int - services_names: str - local_addrs: _containers.RepeatedScalarFieldContainer[str] - 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: ... - -class PeerInfo(_message.Message): - __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] - PEER_ID_FIELD_NUMBER: _ClassVar[int] - CONSENSUS_KEYS_FIELD_NUMBER: _ClassVar[int] - CONSENSUS_ADDRESSES_FIELD_NUMBER: _ClassVar[int] - SERVICES_FIELD_NUMBER: _ClassVar[int] - LAST_BLOCK_HASH_FIELD_NUMBER: _ClassVar[int] - HEIGHT_FIELD_NUMBER: _ClassVar[int] - LAST_SENT_FIELD_NUMBER: _ClassVar[int] - LAST_RECEIVED_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 - peer_id: str - consensus_keys: _containers.RepeatedScalarFieldContainer[str] - consensus_addresses: _containers.RepeatedScalarFieldContainer[str] - services: int - last_block_hash: str - height: int - last_sent: int - last_received: int - address: str - direction: str - protocols: _containers.RepeatedScalarFieldContainer[str] - total_sessions: int - completed_sessions: int - 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") - CONNECTIONS_FIELD_NUMBER: _ClassVar[int] - INBOUND_CONNECTIONS_FIELD_NUMBER: _ClassVar[int] - OUTBOUND_CONNECTIONS_FIELD_NUMBER: _ClassVar[int] - connections: int - inbound_connections: int - outbound_connections: int - 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 deleted file mode 100644 index d9153e6..0000000 --- a/pactus/rpc/network_pb2_grpc.py +++ /dev/null @@ -1,104 +0,0 @@ -# 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. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GetNetworkInfo = channel.unary_unary( - '/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, - ) - - -class NetworkServicer(object): - """Network service provides RPCs for retrieving information about the network. - """ - - def GetNetworkInfo(self, request, context): - """GetNetworkInfo retrieves information about the overall network. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - 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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - 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, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'pactus.Network', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Network(object): - """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, target, '/pactus.Network/GetNetworkInfo', - network__pb2.GetNetworkInfoRequest.SerializeToString, - network__pb2.GetNetworkInfoResponse.FromString, - 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, target, '/pactus.Network/GetNodeInfo', - network__pb2.GetNodeInfoRequest.SerializeToString, - network__pb2.GetNodeInfoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pactus/rpc/ruff.toml b/pactus/rpc/ruff.toml deleted file mode 100644 index f639114..0000000 --- a/pactus/rpc/ruff.toml +++ /dev/null @@ -1,5 +0,0 @@ -[lint] -ignore = ["ALL"] - -[format] -exclude = ["*"] diff --git a/pactus/rpc/transaction_pb2.py b/pactus/rpc/transaction_pb2.py deleted file mode 100644 index ec6a901..0000000 --- a/pactus/rpc/transaction_pb2.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -# 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 -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_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\"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()) -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=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 deleted file mode 100644 index 45e6fc4..0000000 --- a/pactus/rpc/transaction_pb2.pyi +++ /dev/null @@ -1,224 +0,0 @@ -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 - -DESCRIPTOR: _descriptor.FileDescriptor - -class PayloadType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - UNKNOWN: _ClassVar[PayloadType] - TRANSFER_PAYLOAD: _ClassVar[PayloadType] - BOND_PAYLOAD: _ClassVar[PayloadType] - SORTITION_PAYLOAD: _ClassVar[PayloadType] - UNBOND_PAYLOAD: _ClassVar[PayloadType] - WITHDRAW_PAYLOAD: _ClassVar[PayloadType] - -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 -SORTITION_PAYLOAD: PayloadType -UNBOND_PAYLOAD: PayloadType -WITHDRAW_PAYLOAD: PayloadType -TRANSACTION_DATA: TransactionVerbosity -TRANSACTION_INFO: TransactionVerbosity - -class GetTransactionRequest(_message.Message): - __slots__ = ("id", "verbosity") - ID_FIELD_NUMBER: _ClassVar[int] - VERBOSITY_FIELD_NUMBER: _ClassVar[int] - id: str - verbosity: TransactionVerbosity - def __init__(self, id: _Optional[str] = ..., verbosity: _Optional[_Union[TransactionVerbosity, str]] = ...) -> None: ... - -class GetTransactionResponse(_message.Message): - __slots__ = ("block_height", "block_time", "transaction") - BLOCK_HEIGHT_FIELD_NUMBER: _ClassVar[int] - BLOCK_TIME_FIELD_NUMBER: _ClassVar[int] - TRANSACTION_FIELD_NUMBER: _ClassVar[int] - 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: ... - -class CalculateFeeRequest(_message.Message): - __slots__ = ("amount", "payload_type", "fixed_amount") - AMOUNT_FIELD_NUMBER: _ClassVar[int] - PAYLOAD_TYPE_FIELD_NUMBER: _ClassVar[int] - FIXED_AMOUNT_FIELD_NUMBER: _ClassVar[int] - amount: int - payload_type: PayloadType - fixed_amount: bool - def __init__(self, amount: _Optional[int] = ..., payload_type: _Optional[_Union[PayloadType, str]] = ..., fixed_amount: bool = ...) -> None: ... - -class CalculateFeeResponse(_message.Message): - __slots__ = ("amount", "fee") - AMOUNT_FIELD_NUMBER: _ClassVar[int] - FEE_FIELD_NUMBER: _ClassVar[int] - amount: int - fee: int - def __init__(self, amount: _Optional[int] = ..., fee: _Optional[int] = ...) -> None: ... - -class BroadcastTransactionRequest(_message.Message): - __slots__ = ("signed_raw_transaction",) - SIGNED_RAW_TRANSACTION_FIELD_NUMBER: _ClassVar[int] - signed_raw_transaction: str - def __init__(self, signed_raw_transaction: _Optional[str] = ...) -> None: ... - -class BroadcastTransactionResponse(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class GetRawTransferTransactionRequest(_message.Message): - __slots__ = ("lock_time", "sender", "receiver", "amount", "fee", "memo") - LOCK_TIME_FIELD_NUMBER: _ClassVar[int] - SENDER_FIELD_NUMBER: _ClassVar[int] - RECEIVER_FIELD_NUMBER: _ClassVar[int] - AMOUNT_FIELD_NUMBER: _ClassVar[int] - FEE_FIELD_NUMBER: _ClassVar[int] - MEMO_FIELD_NUMBER: _ClassVar[int] - lock_time: int - sender: str - receiver: str - 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: ... - -class GetRawBondTransactionRequest(_message.Message): - __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] - STAKE_FIELD_NUMBER: _ClassVar[int] - PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] - FEE_FIELD_NUMBER: _ClassVar[int] - MEMO_FIELD_NUMBER: _ClassVar[int] - lock_time: int - sender: str - receiver: str - stake: int - 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: ... - -class GetRawUnbondTransactionRequest(_message.Message): - __slots__ = ("lock_time", "validator_address", "memo") - LOCK_TIME_FIELD_NUMBER: _ClassVar[int] - VALIDATOR_ADDRESS_FIELD_NUMBER: _ClassVar[int] - MEMO_FIELD_NUMBER: _ClassVar[int] - lock_time: int - validator_address: str - memo: str - 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") - LOCK_TIME_FIELD_NUMBER: _ClassVar[int] - VALIDATOR_ADDRESS_FIELD_NUMBER: _ClassVar[int] - ACCOUNT_ADDRESS_FIELD_NUMBER: _ClassVar[int] - AMOUNT_FIELD_NUMBER: _ClassVar[int] - FEE_FIELD_NUMBER: _ClassVar[int] - MEMO_FIELD_NUMBER: _ClassVar[int] - lock_time: int - validator_address: str - account_address: str - 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: ... - -class GetRawTransactionResponse(_message.Message): - __slots__ = ("raw_transaction", "id") - RAW_TRANSACTION_FIELD_NUMBER: _ClassVar[int] - ID_FIELD_NUMBER: _ClassVar[int] - raw_transaction: str - id: str - def __init__(self, raw_transaction: _Optional[str] = ..., id: _Optional[str] = ...) -> None: ... - -class PayloadTransfer(_message.Message): - __slots__ = ("sender", "receiver", "amount") - SENDER_FIELD_NUMBER: _ClassVar[int] - RECEIVER_FIELD_NUMBER: _ClassVar[int] - AMOUNT_FIELD_NUMBER: _ClassVar[int] - sender: str - receiver: str - amount: int - def __init__(self, sender: _Optional[str] = ..., receiver: _Optional[str] = ..., amount: _Optional[int] = ...) -> None: ... - -class PayloadBond(_message.Message): - __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 - 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") - ADDRESS_FIELD_NUMBER: _ClassVar[int] - PROOF_FIELD_NUMBER: _ClassVar[int] - address: str - proof: str - def __init__(self, address: _Optional[str] = ..., proof: _Optional[str] = ...) -> None: ... - -class PayloadUnbond(_message.Message): - __slots__ = ("validator",) - VALIDATOR_FIELD_NUMBER: _ClassVar[int] - validator: str - def __init__(self, validator: _Optional[str] = ...) -> None: ... - -class PayloadWithdraw(_message.Message): - __slots__ = ("validator_address", "account_address", "amount") - VALIDATOR_ADDRESS_FIELD_NUMBER: _ClassVar[int] - ACCOUNT_ADDRESS_FIELD_NUMBER: _ClassVar[int] - AMOUNT_FIELD_NUMBER: _ClassVar[int] - validator_address: str - account_address: str - amount: int - 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") - ID_FIELD_NUMBER: _ClassVar[int] - DATA_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - LOCK_TIME_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - FEE_FIELD_NUMBER: _ClassVar[int] - PAYLOAD_TYPE_FIELD_NUMBER: _ClassVar[int] - TRANSFER_FIELD_NUMBER: _ClassVar[int] - BOND_FIELD_NUMBER: _ClassVar[int] - SORTITION_FIELD_NUMBER: _ClassVar[int] - UNBOND_FIELD_NUMBER: _ClassVar[int] - WITHDRAW_FIELD_NUMBER: _ClassVar[int] - MEMO_FIELD_NUMBER: _ClassVar[int] - PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] - SIGNATURE_FIELD_NUMBER: _ClassVar[int] - id: str - data: str - version: int - lock_time: int - value: int - fee: int - payload_type: PayloadType - transfer: PayloadTransfer - bond: PayloadBond - sortition: PayloadSortition - unbond: PayloadUnbond - withdraw: PayloadWithdraw - 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: ... diff --git a/pactus/rpc/transaction_pb2_grpc.py b/pactus/rpc/transaction_pb2_grpc.py deleted file mode 100644 index a41535b..0000000 --- a/pactus/rpc/transaction_pb2_grpc.py +++ /dev/null @@ -1,279 +0,0 @@ -# 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 - - -class TransactionStub(object): - """Transaction service defines various RPC methods for interacting with - transactions. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GetTransaction = channel.unary_unary( - '/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, - ) - self.BroadcastTransaction = channel.unary_unary( - '/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, - ) - self.GetRawBondTransaction = channel.unary_unary( - '/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, - ) - self.GetRawWithdrawTransaction = channel.unary_unary( - '/pactus.Transaction/GetRawWithdrawTransaction', - request_serializer=transaction__pb2.GetRawWithdrawTransactionRequest.SerializeToString, - response_deserializer=transaction__pb2.GetRawTransactionResponse.FromString, - ) - - -class TransactionServicer(object): - """Transaction service defines various RPC methods for interacting with - transactions. - """ - - def GetTransaction(self, request, context): - """GetTransaction retrieves transaction details based on the provided request - parameters. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - 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!') - - def BroadcastTransaction(self, request, context): - """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!') - - def GetRawTransferTransaction(self, request, context): - """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!') - - def GetRawBondTransaction(self, request, context): - """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!') - - def GetRawUnbondTransaction(self, request, context): - """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!') - - def GetRawWithdrawTransaction(self, request, context): - """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!') - - -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, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'pactus.Transaction', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # 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, target, '/pactus.Transaction/GetTransaction', - transaction__pb2.GetTransactionRequest.SerializeToString, - transaction__pb2.GetTransactionResponse.FromString, - 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, target, '/pactus.Transaction/CalculateFee', - transaction__pb2.CalculateFeeRequest.SerializeToString, - transaction__pb2.CalculateFeeResponse.FromString, - 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, target, '/pactus.Transaction/BroadcastTransaction', - transaction__pb2.BroadcastTransactionRequest.SerializeToString, - transaction__pb2.BroadcastTransactionResponse.FromString, - 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, target, '/pactus.Transaction/GetRawTransferTransaction', - transaction__pb2.GetRawTransferTransactionRequest.SerializeToString, - transaction__pb2.GetRawTransactionResponse.FromString, - 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, target, '/pactus.Transaction/GetRawBondTransaction', - transaction__pb2.GetRawBondTransactionRequest.SerializeToString, - transaction__pb2.GetRawTransactionResponse.FromString, - 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, target, '/pactus.Transaction/GetRawUnbondTransaction', - transaction__pb2.GetRawUnbondTransactionRequest.SerializeToString, - transaction__pb2.GetRawTransactionResponse.FromString, - 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, target, '/pactus.Transaction/GetRawWithdrawTransaction', - transaction__pb2.GetRawWithdrawTransactionRequest.SerializeToString, - transaction__pb2.GetRawTransactionResponse.FromString, - 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 deleted file mode 100644 index 2fbe394..0000000 --- a/pactus/rpc/utils_pb2.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -# 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 -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_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\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()) -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 - _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 deleted file mode 100644 index cb74ff2..0000000 --- a/pactus/rpc/utils_pb2.pyi +++ /dev/null @@ -1,62 +0,0 @@ -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, Optional as _Optional - -DESCRIPTOR: _descriptor.FileDescriptor - -class SignMessageWithPrivateKeyRequest(_message.Message): - __slots__ = ("private_key", "message") - PRIVATE_KEY_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - private_key: str - message: str - def __init__(self, private_key: _Optional[str] = ..., message: _Optional[str] = ...) -> None: ... - -class SignMessageWithPrivateKeyResponse(_message.Message): - __slots__ = ("signature",) - SIGNATURE_FIELD_NUMBER: _ClassVar[int] - signature: str - def __init__(self, signature: _Optional[str] = ...) -> None: ... - -class VerifyMessageRequest(_message.Message): - __slots__ = ("message", "signature", "public_key") - MESSAGE_FIELD_NUMBER: _ClassVar[int] - SIGNATURE_FIELD_NUMBER: _ClassVar[int] - PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] - message: str - signature: str - public_key: str - 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 deleted file mode 100644 index d6849ab..0000000 --- a/pactus/rpc/utils_pb2_grpc.py +++ /dev/null @@ -1,175 +0,0 @@ -# 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 - - -class UtilsStub(object): - """Utils service defines RPC methods for utility functions such as message - signing and verification. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SignMessageWithPrivateKey = channel.unary_unary( - '/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, - ) - 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): - """Utils service defines RPC methods for utility functions such as message - signing and verification. - """ - - def SignMessageWithPrivateKey(self, request, context): - """SignMessageWithPrivateKey signs message with provided private key. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def VerifyMessage(self, request, context): - """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!') - - 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, - ), - '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) - server.add_generic_rpc_handlers((generic_handler,)) - - - # 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, target, '/pactus.Utils/SignMessageWithPrivateKey', - utils__pb2.SignMessageWithPrivateKeyRequest.SerializeToString, - utils__pb2.SignMessageWithPrivateKeyResponse.FromString, - 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, target, '/pactus.Utils/VerifyMessage', - utils__pb2.VerifyMessageRequest.SerializeToString, - utils__pb2.VerifyMessageResponse.FromString, - 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 deleted file mode 100644 index 0fa2ae8..0000000 --- a/pactus/rpc/wallet_pb2.py +++ /dev/null @@ -1,97 +0,0 @@ -# -*- coding: utf-8 -*- -# 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 -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -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\"\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()) -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=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 deleted file mode 100644 index e74382a..0000000 --- a/pactus/rpc/wallet_pb2.pyi +++ /dev/null @@ -1,291 +0,0 @@ -import transaction_pb2 as _transaction_pb2 -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 - -DESCRIPTOR: _descriptor.FileDescriptor - -class AddressType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - 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") - ADDRESS_FIELD_NUMBER: _ClassVar[int] - PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] - LABEL_FIELD_NUMBER: _ClassVar[int] - PATH_FIELD_NUMBER: _ClassVar[int] - address: str - public_key: str - label: str - path: str - 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") - TRANSACTION_ID_FIELD_NUMBER: _ClassVar[int] - TIME_FIELD_NUMBER: _ClassVar[int] - PAYLOAD_TYPE_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - AMOUNT_FIELD_NUMBER: _ClassVar[int] - transaction_id: str - time: int - 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: ... - -class GetAddressHistoryRequest(_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 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: ... - -class GetNewAddressRequest(_message.Message): - __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 - 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") - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - 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: ... - -class RestoreWalletRequest(_message.Message): - __slots__ = ("wallet_name", "mnemonic", "password") - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - MNEMONIC_FIELD_NUMBER: _ClassVar[int] - PASSWORD_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - mnemonic: str - password: str - def __init__(self, wallet_name: _Optional[str] = ..., mnemonic: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... - -class RestoreWalletResponse(_message.Message): - __slots__ = ("wallet_name",) - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... - -class CreateWalletRequest(_message.Message): - __slots__ = ("wallet_name", "password") - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - PASSWORD_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - password: str - def __init__(self, wallet_name: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... - -class CreateWalletResponse(_message.Message): - __slots__ = ("mnemonic",) - MNEMONIC_FIELD_NUMBER: _ClassVar[int] - mnemonic: str - def __init__(self, mnemonic: _Optional[str] = ...) -> None: ... - -class LoadWalletRequest(_message.Message): - __slots__ = ("wallet_name",) - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... - -class LoadWalletResponse(_message.Message): - __slots__ = ("wallet_name",) - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... - -class UnloadWalletRequest(_message.Message): - __slots__ = ("wallet_name",) - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... - -class UnloadWalletResponse(_message.Message): - __slots__ = ("wallet_name",) - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... - -class GetValidatorAddressRequest(_message.Message): - __slots__ = ("public_key",) - PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] - public_key: str - def __init__(self, public_key: _Optional[str] = ...) -> None: ... - -class GetValidatorAddressResponse(_message.Message): - __slots__ = ("address",) - ADDRESS_FIELD_NUMBER: _ClassVar[int] - address: str - def __init__(self, address: _Optional[str] = ...) -> None: ... - -class SignRawTransactionRequest(_message.Message): - __slots__ = ("wallet_name", "raw_transaction", "password") - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - RAW_TRANSACTION_FIELD_NUMBER: _ClassVar[int] - PASSWORD_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - raw_transaction: str - password: str - 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") - TRANSACTION_ID_FIELD_NUMBER: _ClassVar[int] - 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: ... - -class GetTotalBalanceRequest(_message.Message): - __slots__ = ("wallet_name",) - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - def __init__(self, wallet_name: _Optional[str] = ...) -> None: ... - -class GetTotalBalanceResponse(_message.Message): - __slots__ = ("wallet_name", "total_balance") - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - TOTAL_BALANCE_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - total_balance: int - def __init__(self, wallet_name: _Optional[str] = ..., total_balance: _Optional[int] = ...) -> None: ... - -class SignMessageRequest(_message.Message): - __slots__ = ("wallet_name", "password", "address", "message") - WALLET_NAME_FIELD_NUMBER: _ClassVar[int] - PASSWORD_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - wallet_name: str - password: str - address: str - message: str - 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 deleted file mode 100644 index 5f3c9bd..0000000 --- a/pactus/rpc/wallet_pb2_grpc.py +++ /dev/null @@ -1,581 +0,0 @@ -# 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. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateWallet = channel.unary_unary( - '/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, - ) - self.LoadWallet = channel.unary_unary( - '/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, - ) - self.GetTotalBalance = channel.unary_unary( - '/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, - ) - self.GetValidatorAddress = channel.unary_unary( - '/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, - ) - self.GetAddressHistory = channel.unary_unary( - '/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, - ) - 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. - """ - - def CreateWallet(self, request, context): - """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!') - - def RestoreWallet(self, request, context): - """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!') - - def LoadWallet(self, request, context): - """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!') - - def UnloadWallet(self, request, context): - """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!') - - def GetTotalBalance(self, request, context): - """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!') - - def SignRawTransaction(self, request, context): - """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!') - - 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!') - - def GetNewAddress(self, request, context): - """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!') - - def GetAddressHistory(self, request, context): - """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!') - - def SignMessage(self, request, context): - """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!') - - -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, - ), - '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) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Wallet(object): - """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, target, '/pactus.Wallet/CreateWallet', - wallet__pb2.CreateWalletRequest.SerializeToString, - wallet__pb2.CreateWalletResponse.FromString, - 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, target, '/pactus.Wallet/RestoreWallet', - wallet__pb2.RestoreWalletRequest.SerializeToString, - wallet__pb2.RestoreWalletResponse.FromString, - 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, target, '/pactus.Wallet/LoadWallet', - wallet__pb2.LoadWalletRequest.SerializeToString, - wallet__pb2.LoadWalletResponse.FromString, - 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, target, '/pactus.Wallet/UnloadWallet', - wallet__pb2.UnloadWalletRequest.SerializeToString, - wallet__pb2.UnloadWalletResponse.FromString, - 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, target, '/pactus.Wallet/GetTotalBalance', - wallet__pb2.GetTotalBalanceRequest.SerializeToString, - wallet__pb2.GetTotalBalanceResponse.FromString, - 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, target, '/pactus.Wallet/SignRawTransaction', - wallet__pb2.SignRawTransactionRequest.SerializeToString, - wallet__pb2.SignRawTransactionResponse.FromString, - 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, target, '/pactus.Wallet/GetValidatorAddress', - wallet__pb2.GetValidatorAddressRequest.SerializeToString, - wallet__pb2.GetValidatorAddressResponse.FromString, - 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, target, '/pactus.Wallet/GetNewAddress', - wallet__pb2.GetNewAddressRequest.SerializeToString, - wallet__pb2.GetNewAddressResponse.FromString, - 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, target, '/pactus.Wallet/GetAddressHistory', - wallet__pb2.GetAddressHistoryRequest.SerializeToString, - wallet__pb2.GetAddressHistoryResponse.FromString, - 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, target, '/pactus.Wallet/SignMessage', - wallet__pb2.SignMessageRequest.SerializeToString, - wallet__pb2.SignMessageResponse.FromString, - 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/setup.py b/setup.py index d95675a..7c41ea8 100644 --- a/setup.py +++ b/setup.py @@ -1,44 +1,32 @@ -import codecs from pathlib import Path from setuptools import find_packages, setup -# Get the directory where this setup.py file is located -here = Path(__file__).resolve().parent - -with codecs.open(here / "README.md", encoding="utf-8") as fh: - long_description = fh.read() - -NAME = "pactus-sdk" -VERSION = "1.2.3" -AUTHOR = "Pactus Development Team" -AUTHOR_EMAIL = "info@pactus.org" -DESCRIPTION = "Pactus Development Kit" -LONG_DESCRIPTION_CONTENT_TYPE = "text/markdown" -URL = "https://github.com/pactus-project/python-sdk" - -# Package dependencies -REQUIRED = ["ripemd-hash", "grpcio", "grpcio-tools", "cryptography>=43.0", "zmq"] - -CLASSIFIERS = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", -] - setup( - name=NAME, - version=VERSION, - author=AUTHOR, - author_email=AUTHOR_EMAIL, - description=DESCRIPTION, - long_description=long_description, - long_description_content_type=LONG_DESCRIPTION_CONTENT_TYPE, - url=URL, + name="pactus-sdk", + version="1.2.3", + author="Pactus Development Team", + author_email="info@pactus.org", + description="Pactus Development Kit", + long_description=Path.open("README.md", encoding="utf-8").read(), + long_description_content_type="text/markdown", + url="https://github.com/pactus-project/python-sdk", packages=find_packages(), - install_requires=REQUIRED, - keywords=["pactus", "blockchain", "web3", "dapp", "bls", "bech32"], - classifiers=CLASSIFIERS, + license="MIT", + install_requires=[ + "pactus_grpc", + "ripemd-hash", + "grpcio", + "grpcio-tools", + "cryptography>=43.0", + "zmq", + ], + keywords=["pactus", "blockchain", "sdk", "web3", "dapp", "bls", "bech32"], + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + ], python_requires=">=3.6", ) From ba060539b96ed9eedf88c5af9f166dbeed1be8dd Mon Sep 17 00:00:00 2001 From: Mostafa Date: Mon, 14 Apr 2025 12:40:23 +0800 Subject: [PATCH 2/3] chore: fix linting issues --- .github/workflows/examples.yml | 2 +- .github/workflows/test.yml | 2 +- pactus/utils/bech32m.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 8b0640b..459b573 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -23,7 +23,7 @@ jobs: - name: Install locally run: | - pip install -e . + python3 -m pip install . - name: Run all Examples run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffa4cff..47b2c36 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Install locally run: | - pip install -e . + python3 -m pip install . - name: Run tests run: | diff --git a/pactus/utils/bech32m.py b/pactus/utils/bech32m.py index 4f600d1..c3ca184 100644 --- a/pactus/utils/bech32m.py +++ b/pactus/utils/bech32m.py @@ -1,4 +1,4 @@ -# ruff: noqa +# ruff: noqa: ANN001, ANN201, RUF005, RUF021, FBT002, FBT003, D401 # Copyright (c) 2017, 2020 Pieter Wuille # From 1d42143e38bef4cfe2512332ff7d046d697ffa8e Mon Sep 17 00:00:00 2001 From: Mostafa Date: Mon, 14 Apr 2025 12:43:29 +0800 Subject: [PATCH 3/3] chore: fix installing issue --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7c41ea8..adeba21 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ author="Pactus Development Team", author_email="info@pactus.org", description="Pactus Development Kit", - long_description=Path.open("README.md", encoding="utf-8").read(), + long_description=Path("README.md").read_text(encoding="utf-8"), long_description_content_type="text/markdown", url="https://github.com/pactus-project/python-sdk", packages=find_packages(),