repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
bcb/jsonrpcclient | jsonrpcclient/response.py | sort_response | def sort_response(response: Dict[str, Any]) -> OrderedDict:
"""
Sort the keys in a JSON-RPC response object.
This has no effect other than making it nicer to read. Useful in Python 3.5 only,
dictionaries are already sorted in newer Python versions.
Example::
>>> json.dumps(sort_response({... | python | def sort_response(response: Dict[str, Any]) -> OrderedDict:
"""
Sort the keys in a JSON-RPC response object.
This has no effect other than making it nicer to read. Useful in Python 3.5 only,
dictionaries are already sorted in newer Python versions.
Example::
>>> json.dumps(sort_response({... | Sort the keys in a JSON-RPC response object.
This has no effect other than making it nicer to read. Useful in Python 3.5 only,
dictionaries are already sorted in newer Python versions.
Example::
>>> json.dumps(sort_response({'id': 2, 'result': 5, 'jsonrpc': '2.0'}))
{"jsonrpc": "2.0", "re... | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/response.py#L13-L38 |
bcb/jsonrpcclient | jsonrpcclient/response.py | total_results | def total_results(
data: Union[List[JSONRPCResponse], JSONRPCResponse, None], *, ok: bool = True
) -> int:
"""
Returns the total parsed responses, given the return value from parse().
"""
if isinstance(data, list):
return sum([1 for d in data if d.ok == ok])
elif isinstance(data, JSONRPC... | python | def total_results(
data: Union[List[JSONRPCResponse], JSONRPCResponse, None], *, ok: bool = True
) -> int:
"""
Returns the total parsed responses, given the return value from parse().
"""
if isinstance(data, list):
return sum([1 for d in data if d.ok == ok])
elif isinstance(data, JSONRPC... | Returns the total parsed responses, given the return value from parse(). | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/response.py#L121-L131 |
bcb/jsonrpcclient | jsonrpcclient/clients/aiohttp_client.py | AiohttpClient.send_message | async def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a res... | python | async def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a res... | Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.
Returns:
A Response object. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/clients/aiohttp_client.py#L53-L71 |
bcb/jsonrpcclient | jsonrpcclient/clients/websockets_client.py | WebSocketsClient.send_message | async def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a res... | python | async def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a res... | Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.
Returns:
A Response object. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/clients/websockets_client.py#L25-L42 |
bcb/jsonrpcclient | jsonrpcclient/config.py | parse_callable | def parse_callable(path: str) -> Iterator:
"""
ConfigParser converter.
Calls the specified object, e.g. Option "id_generators.decimal" returns
`id_generators.decimal()`.
"""
module = path[: path.rindex(".")]
callable_name = path[path.rindex(".") + 1 :]
callable_ = getattr(importlib.impo... | python | def parse_callable(path: str) -> Iterator:
"""
ConfigParser converter.
Calls the specified object, e.g. Option "id_generators.decimal" returns
`id_generators.decimal()`.
"""
module = path[: path.rindex(".")]
callable_name = path[path.rindex(".") + 1 :]
callable_ = getattr(importlib.impo... | ConfigParser converter.
Calls the specified object, e.g. Option "id_generators.decimal" returns
`id_generators.decimal()`. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/config.py#L12-L22 |
bcb/jsonrpcclient | jsonrpcclient/id_generators.py | random | def random(length: int = 8, chars: str = digits + ascii_lowercase) -> Iterator[str]:
"""
A random string.
Not unique, but has around 1 in a million chance of collision (with the default 8
character length). e.g. 'fubui5e6'
Args:
length: Length of the random string.
chars: The chara... | python | def random(length: int = 8, chars: str = digits + ascii_lowercase) -> Iterator[str]:
"""
A random string.
Not unique, but has around 1 in a million chance of collision (with the default 8
character length). e.g. 'fubui5e6'
Args:
length: Length of the random string.
chars: The chara... | A random string.
Not unique, but has around 1 in a million chance of collision (with the default 8
character length). e.g. 'fubui5e6'
Args:
length: Length of the random string.
chars: The characters to randomly choose from. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/id_generators.py#L40-L52 |
bcb/jsonrpcclient | jsonrpcclient/parse.py | get_response | def get_response(response: Dict[str, Any]) -> JSONRPCResponse:
"""
Converts a deserialized response into a JSONRPCResponse object.
The dictionary be either an error or success response, never a notification.
Args:
response: Deserialized response dictionary. We can assume the response is valid
... | python | def get_response(response: Dict[str, Any]) -> JSONRPCResponse:
"""
Converts a deserialized response into a JSONRPCResponse object.
The dictionary be either an error or success response, never a notification.
Args:
response: Deserialized response dictionary. We can assume the response is valid
... | Converts a deserialized response into a JSONRPCResponse object.
The dictionary be either an error or success response, never a notification.
Args:
response: Deserialized response dictionary. We can assume the response is valid
JSON-RPC here, since it passed the jsonschema validation. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/parse.py#L18-L30 |
bcb/jsonrpcclient | jsonrpcclient/parse.py | parse | def parse(
response_text: str, *, batch: bool, validate_against_schema: bool = True
) -> Union[JSONRPCResponse, List[JSONRPCResponse]]:
"""
Parses response text, returning JSONRPCResponse objects.
Args:
response_text: JSON-RPC response string.
batch: If the response_text is an empty str... | python | def parse(
response_text: str, *, batch: bool, validate_against_schema: bool = True
) -> Union[JSONRPCResponse, List[JSONRPCResponse]]:
"""
Parses response text, returning JSONRPCResponse objects.
Args:
response_text: JSON-RPC response string.
batch: If the response_text is an empty str... | Parses response text, returning JSONRPCResponse objects.
Args:
response_text: JSON-RPC response string.
batch: If the response_text is an empty string, this determines how to parse.
validate_against_schema: Validate against the json-rpc schema.
Returns:
Either a JSONRPCResponse... | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/parse.py#L33-L75 |
bcb/jsonrpcclient | jsonrpcclient/async_client.py | AsyncClient.send | async def send(
self,
request: Union[str, Dict, List],
trim_log_values: bool = False,
validate_against_schema: bool = True,
**kwargs: Any
) -> Response:
"""
Async version of Client.send.
"""
# We need both the serialized and deserialized versio... | python | async def send(
self,
request: Union[str, Dict, List],
trim_log_values: bool = False,
validate_against_schema: bool = True,
**kwargs: Any
) -> Response:
"""
Async version of Client.send.
"""
# We need both the serialized and deserialized versio... | Async version of Client.send. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/async_client.py#L32-L63 |
bcb/jsonrpcclient | jsonrpcclient/clients/tornado_client.py | TornadoClient.send_message | async def send_message( # type: ignore
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the reque... | python | async def send_message( # type: ignore
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the reque... | Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.
Returns:
A Response object. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/clients/tornado_client.py#L46-L66 |
bcb/jsonrpcclient | jsonrpcclient/__main__.py | main | def main(
context: click.core.Context, method: str, request_type: str, id: Any, send: str
) -> None:
"""
Create a JSON-RPC request.
"""
exit_status = 0
# Extract the jsonrpc arguments
positional = [a for a in context.args if "=" not in a]
named = {a.split("=")[0]: a.split("=")[1] for a i... | python | def main(
context: click.core.Context, method: str, request_type: str, id: Any, send: str
) -> None:
"""
Create a JSON-RPC request.
"""
exit_status = 0
# Extract the jsonrpc arguments
positional = [a for a in context.args if "=" not in a]
named = {a.split("=")[0]: a.split("=")[1] for a i... | Create a JSON-RPC request. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/__main__.py#L40-L68 |
bcb/jsonrpcclient | jsonrpcclient/log.py | log_ | def log_(
message: str,
logger: logging.Logger,
level: str = "info",
extra: Optional[Dict] = None,
trim: bool = False,
) -> None:
"""
Log a request or response
Args:
message: JSON-RPC request or response string.
level: Log level.
extra: More details to include in... | python | def log_(
message: str,
logger: logging.Logger,
level: str = "info",
extra: Optional[Dict] = None,
trim: bool = False,
) -> None:
"""
Log a request or response
Args:
message: JSON-RPC request or response string.
level: Log level.
extra: More details to include in... | Log a request or response
Args:
message: JSON-RPC request or response string.
level: Log level.
extra: More details to include in the log entry.
trim: Abbreviate log messages. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/log.py#L54-L78 |
bcb/jsonrpcclient | jsonrpcclient/requests.py | sort_request | def sort_request(request: Dict[str, Any]) -> OrderedDict:
"""
Sort a JSON-RPC request dict.
This has no effect other than making the request nicer to read.
>>> json.dumps(sort_request(
... {'id': 2, 'params': [2, 3], 'method': 'add', 'jsonrpc': '2.0'}))
'{"jsonrpc": "2.0", "met... | python | def sort_request(request: Dict[str, Any]) -> OrderedDict:
"""
Sort a JSON-RPC request dict.
This has no effect other than making the request nicer to read.
>>> json.dumps(sort_request(
... {'id': 2, 'params': [2, 3], 'method': 'add', 'jsonrpc': '2.0'}))
'{"jsonrpc": "2.0", "met... | Sort a JSON-RPC request dict.
This has no effect other than making the request nicer to read.
>>> json.dumps(sort_request(
... {'id': 2, 'params': [2, 3], 'method': 'add', 'jsonrpc': '2.0'}))
'{"jsonrpc": "2.0", "method": "add", "params": [2, 3], "id": 2}'
Args:
request: J... | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/requests.py#L18-L32 |
bcb/jsonrpcclient | jsonrpcclient/client.py | Client.basic_logging | def basic_logging(self) -> None:
"""
Call this on the client object to create log handlers to output request and
response messages.
"""
# Request handler
if len(request_log.handlers) == 0:
request_handler = logging.StreamHandler()
request_handler.s... | python | def basic_logging(self) -> None:
"""
Call this on the client object to create log handlers to output request and
response messages.
"""
# Request handler
if len(request_log.handlers) == 0:
request_handler = logging.StreamHandler()
request_handler.s... | Call this on the client object to create log handlers to output request and
response messages. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/client.py#L57-L77 |
bcb/jsonrpcclient | jsonrpcclient/client.py | Client.log_request | def log_request(
self, request: str, trim_log_values: bool = False, **kwargs: Any
) -> None:
"""
Log a request.
Args:
request: The JSON-RPC request string.
trim_log_values: Log an abbreviated version of the request.
"""
return log_(request, re... | python | def log_request(
self, request: str, trim_log_values: bool = False, **kwargs: Any
) -> None:
"""
Log a request.
Args:
request: The JSON-RPC request string.
trim_log_values: Log an abbreviated version of the request.
"""
return log_(request, re... | Log a request.
Args:
request: The JSON-RPC request string.
trim_log_values: Log an abbreviated version of the request. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/client.py#L80-L90 |
bcb/jsonrpcclient | jsonrpcclient/client.py | Client.log_response | def log_response(
self, response: Response, trim_log_values: bool = False, **kwargs: Any
) -> None:
"""
Log a response.
Note this is different to log_request, in that it takes a Response object, not a
string.
Args:
response: The Response object to log. N... | python | def log_response(
self, response: Response, trim_log_values: bool = False, **kwargs: Any
) -> None:
"""
Log a response.
Note this is different to log_request, in that it takes a Response object, not a
string.
Args:
response: The Response object to log. N... | Log a response.
Note this is different to log_request, in that it takes a Response object, not a
string.
Args:
response: The Response object to log. Note this is different to log_request
which takes a string.
trim_log_values: Log an abbreviated version o... | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/client.py#L93-L107 |
bcb/jsonrpcclient | jsonrpcclient/client.py | Client.notify | def notify(
self,
method_name: str,
*args: Any,
trim_log_values: Optional[bool] = None,
validate_against_schema: Optional[bool] = None,
**kwargs: Any
) -> Response:
"""
Send a JSON-RPC request, without expecting a response.
Args:
m... | python | def notify(
self,
method_name: str,
*args: Any,
trim_log_values: Optional[bool] = None,
validate_against_schema: Optional[bool] = None,
**kwargs: Any
) -> Response:
"""
Send a JSON-RPC request, without expecting a response.
Args:
m... | Send a JSON-RPC request, without expecting a response.
Args:
method_name: The remote procedure's method name.
args: Positional arguments passed to the remote procedure.
kwargs: Keyword arguments passed to the remote procedure.
trim_log_values: Abbreviate the log ... | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/client.py#L181-L203 |
bcb/jsonrpcclient | jsonrpcclient/client.py | Client.request | def request(
self,
method_name: str,
*args: Any,
trim_log_values: bool = False,
validate_against_schema: bool = True,
id_generator: Optional[Iterator] = None,
**kwargs: Any
) -> Response:
"""
Send a request by passing the method and arguments.
... | python | def request(
self,
method_name: str,
*args: Any,
trim_log_values: bool = False,
validate_against_schema: bool = True,
id_generator: Optional[Iterator] = None,
**kwargs: Any
) -> Response:
"""
Send a request by passing the method and arguments.
... | Send a request by passing the method and arguments.
>>> client.request("cat", name="Yoko")
<Response[1]
Args:
method_name: The remote procedure's method name.
args: Positional arguments passed to the remote procedure.
kwargs: Keyword arguments passed to the ... | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/client.py#L206-L233 |
bcb/jsonrpcclient | jsonrpcclient/clients/socket_client.py | SocketClient.send_message | def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.... | python | def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.... | Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.
Returns:
A Response object. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/clients/socket_client.py#L35-L68 |
bcb/jsonrpcclient | jsonrpcclient/clients/http_client.py | HTTPClient.send_message | def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.... | python | def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.... | Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.
Returns:
A Response object. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/clients/http_client.py#L50-L64 |
bcb/jsonrpcclient | jsonrpcclient/clients/zeromq_client.py | ZeroMQClient.send_message | def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.... | python | def send_message(
self, request: str, response_expected: bool, **kwargs: Any
) -> Response:
"""
Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.... | Transport the message to the server and return the response.
Args:
request: The JSON-RPC request string.
response_expected: Whether the request expects a response.
Returns:
A Response object. | https://github.com/bcb/jsonrpcclient/blob/5b5abc28d1466d694c80b80c427a5dcb275382bb/jsonrpcclient/clients/zeromq_client.py#L28-L42 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/oep4.py | Oep4.init | def init(self, acct: Account, payer_acct: Account, gas_limit: int, gas_price: int) -> str:
"""
This interface is used to call the TotalSupply method in ope4
that initialize smart contract parameter.
:param acct: an Account class that used to sign the transaction.
:param payer_ac... | python | def init(self, acct: Account, payer_acct: Account, gas_limit: int, gas_price: int) -> str:
"""
This interface is used to call the TotalSupply method in ope4
that initialize smart contract parameter.
:param acct: an Account class that used to sign the transaction.
:param payer_ac... | This interface is used to call the TotalSupply method in ope4
that initialize smart contract parameter.
:param acct: an Account class that used to sign the transaction.
:param payer_acct: an Account class that used to pay for the transaction.
:param gas_limit: an int value that indicate... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/oep4.py#L73-L87 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/oep4.py | Oep4.get_total_supply | def get_total_supply(self) -> int:
"""
This interface is used to call the TotalSupply method in ope4
that return the total supply of the oep4 token.
:return: the total supply of the oep4 token.
"""
func = InvokeFunction('totalSupply')
response = self.__sdk.get_ne... | python | def get_total_supply(self) -> int:
"""
This interface is used to call the TotalSupply method in ope4
that return the total supply of the oep4 token.
:return: the total supply of the oep4 token.
"""
func = InvokeFunction('totalSupply')
response = self.__sdk.get_ne... | This interface is used to call the TotalSupply method in ope4
that return the total supply of the oep4 token.
:return: the total supply of the oep4 token. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/oep4.py#L89-L102 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/oep4.py | Oep4.balance_of | def balance_of(self, b58_address: str) -> int:
"""
This interface is used to call the BalanceOf method in ope4
that query the ope4 token balance of the given base58 encode address.
:param b58_address: the base58 encode address.
:return: the oep4 token balance of the base58 encod... | python | def balance_of(self, b58_address: str) -> int:
"""
This interface is used to call the BalanceOf method in ope4
that query the ope4 token balance of the given base58 encode address.
:param b58_address: the base58 encode address.
:return: the oep4 token balance of the base58 encod... | This interface is used to call the BalanceOf method in ope4
that query the ope4 token balance of the given base58 encode address.
:param b58_address: the base58 encode address.
:return: the oep4 token balance of the base58 encode address. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/oep4.py#L104-L121 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/oep4.py | Oep4.transfer | def transfer(self, from_acct: Account, b58_to_address: str, value: int, payer_acct: Account, gas_limit: int,
gas_price: int) -> str:
"""
This interface is used to call the Transfer method in ope4
that transfer an amount of tokens from one account to another account.
:pa... | python | def transfer(self, from_acct: Account, b58_to_address: str, value: int, payer_acct: Account, gas_limit: int,
gas_price: int) -> str:
"""
This interface is used to call the Transfer method in ope4
that transfer an amount of tokens from one account to another account.
:pa... | This interface is used to call the Transfer method in ope4
that transfer an amount of tokens from one account to another account.
:param from_acct: an Account class that send the oep4 token.
:param b58_to_address: a base58 encode address that receive the oep4 token.
:param value: an int... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/oep4.py#L123-L150 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/oep4.py | Oep4.transfer_multi | def transfer_multi(self, transfer_list: list, payer_acct: Account, signers: list, gas_limit: int, gas_price: int):
"""
This interface is used to call the TransferMulti method in ope4
that allow transfer amount of token from multiple from-account to multiple to-account multiple times.
:p... | python | def transfer_multi(self, transfer_list: list, payer_acct: Account, signers: list, gas_limit: int, gas_price: int):
"""
This interface is used to call the TransferMulti method in ope4
that allow transfer amount of token from multiple from-account to multiple to-account multiple times.
:p... | This interface is used to call the TransferMulti method in ope4
that allow transfer amount of token from multiple from-account to multiple to-account multiple times.
:param transfer_list: a parameter list with each item contains three sub-items:
base58 encode transaction sender address,... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/oep4.py#L175-L218 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/oep4.py | Oep4.approve | def approve(self, owner_acct: Account, b58_spender_address: str, amount: int, payer_acct: Account, gas_limit: int,
gas_price: int):
"""
This interface is used to call the Approve method in ope4
that allows spender to withdraw a certain amount of oep4 token from owner account mult... | python | def approve(self, owner_acct: Account, b58_spender_address: str, amount: int, payer_acct: Account, gas_limit: int,
gas_price: int):
"""
This interface is used to call the Approve method in ope4
that allows spender to withdraw a certain amount of oep4 token from owner account mult... | This interface is used to call the Approve method in ope4
that allows spender to withdraw a certain amount of oep4 token from owner account multiple times.
If this function is called again, it will overwrite the current allowance with new value.
:param owner_acct: an Account class that indicat... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/oep4.py#L220-L247 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/oep4.py | Oep4.allowance | def allowance(self, b58_owner_address: str, b58_spender_address: str):
"""
This interface is used to call the Allowance method in ope4
that query the amount of spender still allowed to withdraw from owner account.
:param b58_owner_address: a base58 encode address that represent owner's ... | python | def allowance(self, b58_owner_address: str, b58_spender_address: str):
"""
This interface is used to call the Allowance method in ope4
that query the amount of spender still allowed to withdraw from owner account.
:param b58_owner_address: a base58 encode address that represent owner's ... | This interface is used to call the Allowance method in ope4
that query the amount of spender still allowed to withdraw from owner account.
:param b58_owner_address: a base58 encode address that represent owner's account.
:param b58_spender_address: a base58 encode address that represent spender... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/oep4.py#L249-L269 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/oep4.py | Oep4.transfer_from | def transfer_from(self, spender_acct: Account, b58_from_address: str, b58_to_address: str, value: int,
payer_acct: Account, gas_limit: int, gas_price: int):
"""
This interface is used to call the Allowance method in ope4
that allow spender to withdraw amount of oep4 token f... | python | def transfer_from(self, spender_acct: Account, b58_from_address: str, b58_to_address: str, value: int,
payer_acct: Account, gas_limit: int, gas_price: int):
"""
This interface is used to call the Allowance method in ope4
that allow spender to withdraw amount of oep4 token f... | This interface is used to call the Allowance method in ope4
that allow spender to withdraw amount of oep4 token from from-account to to-account.
:param spender_acct: an Account class that actually spend oep4 token.
:param b58_from_address: an base58 encode address that actually pay oep4 token f... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/oep4.py#L271-L314 |
ontio/ontology-python-sdk | ontology/wallet/wallet_manager.py | WalletManager.import_identity | def import_identity(self, label: str, encrypted_pri_key: str, pwd: str, salt: str, b58_address: str) -> Identity:
"""
This interface is used to import identity by providing encrypted private key, password, salt and
base58 encode address which should be correspond to the encrypted private key pro... | python | def import_identity(self, label: str, encrypted_pri_key: str, pwd: str, salt: str, b58_address: str) -> Identity:
"""
This interface is used to import identity by providing encrypted private key, password, salt and
base58 encode address which should be correspond to the encrypted private key pro... | This interface is used to import identity by providing encrypted private key, password, salt and
base58 encode address which should be correspond to the encrypted private key provided.
:param label: a label for identity.
:param encrypted_pri_key: an encrypted private key in base64 encoding from... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet_manager.py#L140-L158 |
ontio/ontology-python-sdk | ontology/wallet/wallet_manager.py | WalletManager.create_identity_from_private_key | def create_identity_from_private_key(self, label: str, pwd: str, private_key: str) -> Identity:
"""
This interface is used to create identity based on given label, password and private key.
:param label: a label for identity.
:param pwd: a password which will be used to encrypt and decr... | python | def create_identity_from_private_key(self, label: str, pwd: str, private_key: str) -> Identity:
"""
This interface is used to create identity based on given label, password and private key.
:param label: a label for identity.
:param pwd: a password which will be used to encrypt and decr... | This interface is used to create identity based on given label, password and private key.
:param label: a label for identity.
:param pwd: a password which will be used to encrypt and decrypt the private key.
:param private_key: a private key in the form of string.
:return: if succeed, a... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet_manager.py#L178-L189 |
ontio/ontology-python-sdk | ontology/wallet/wallet_manager.py | WalletManager.create_account | def create_account(self, pwd: str, label: str = '') -> Account:
"""
This interface is used to create account based on given password and label.
:param label: a label for account.
:param pwd: a password which will be used to encrypt and decrypt the private key
:return: if succeed... | python | def create_account(self, pwd: str, label: str = '') -> Account:
"""
This interface is used to create account based on given password and label.
:param label: a label for account.
:param pwd: a password which will be used to encrypt and decrypt the private key
:return: if succeed... | This interface is used to create account based on given password and label.
:param label: a label for account.
:param pwd: a password which will be used to encrypt and decrypt the private key
:return: if succeed, return an data structure which contain the information of a wallet account. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet_manager.py#L191-L204 |
ontio/ontology-python-sdk | ontology/wallet/wallet_manager.py | WalletManager.import_account | def import_account(self, label: str, encrypted_pri_key: str, pwd: str, b58_address: str,
b64_salt: str, n: int = 16384) -> AccountData:
"""
This interface is used to import account by providing account data.
:param label: str, wallet label
:param encrypted_pri_key... | python | def import_account(self, label: str, encrypted_pri_key: str, pwd: str, b58_address: str,
b64_salt: str, n: int = 16384) -> AccountData:
"""
This interface is used to import account by providing account data.
:param label: str, wallet label
:param encrypted_pri_key... | This interface is used to import account by providing account data.
:param label: str, wallet label
:param encrypted_pri_key: str, an encrypted private key in base64 encoding from
:param pwd: str, a password which is used to encrypt and decrypt the private key
:param b58_address: str, a... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet_manager.py#L289-L312 |
ontio/ontology-python-sdk | ontology/wallet/wallet_manager.py | WalletManager.create_account_from_private_key | def create_account_from_private_key(self, password: str, private_key: str, label: str = '') -> AccountData:
"""
This interface is used to create account by providing an encrypted private key and it's decrypt password.
:param label: a label for account.
:param password: a password which ... | python | def create_account_from_private_key(self, password: str, private_key: str, label: str = '') -> AccountData:
"""
This interface is used to create account by providing an encrypted private key and it's decrypt password.
:param label: a label for account.
:param password: a password which ... | This interface is used to create account by providing an encrypted private key and it's decrypt password.
:param label: a label for account.
:param password: a password which is used to decrypt the encrypted private key.
:param private_key: a private key in the form of string.
:return: ... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet_manager.py#L324-L341 |
ontio/ontology-python-sdk | ontology/wallet/wallet_manager.py | WalletManager.get_account_by_ont_id | def get_account_by_ont_id(self, ont_id: str, password: str) -> Account:
"""
:param ont_id: OntId.
:param password: a password which is used to decrypt the encrypted private key.
:return:
"""
WalletManager.__check_ont_id(ont_id)
for identity in self.wallet_in_mem.i... | python | def get_account_by_ont_id(self, ont_id: str, password: str) -> Account:
"""
:param ont_id: OntId.
:param password: a password which is used to decrypt the encrypted private key.
:return:
"""
WalletManager.__check_ont_id(ont_id)
for identity in self.wallet_in_mem.i... | :param ont_id: OntId.
:param password: a password which is used to decrypt the encrypted private key.
:return: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet_manager.py#L351-L366 |
ontio/ontology-python-sdk | ontology/wallet/wallet_manager.py | WalletManager.get_account_by_b58_address | def get_account_by_b58_address(self, b58_address: str, password: str) -> Account:
"""
:param b58_address: a base58 encode address.
:param password: a password which is used to decrypt the encrypted private key.
:return:
"""
acct = self.get_account_data_by_b58_address(b58_... | python | def get_account_by_b58_address(self, b58_address: str, password: str) -> Account:
"""
:param b58_address: a base58 encode address.
:param password: a password which is used to decrypt the encrypted private key.
:return:
"""
acct = self.get_account_data_by_b58_address(b58_... | :param b58_address: a base58 encode address.
:param password: a password which is used to decrypt the encrypted private key.
:return: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet_manager.py#L422-L432 |
ontio/ontology-python-sdk | ontology/wallet/wallet_manager.py | WalletManager.get_default_account_data | def get_default_account_data(self) -> AccountData:
"""
This interface is used to get the default account in WalletManager.
:return: an AccountData object that contain all the information of a default account.
"""
for acct in self.wallet_in_mem.accounts:
if not isinst... | python | def get_default_account_data(self) -> AccountData:
"""
This interface is used to get the default account in WalletManager.
:return: an AccountData object that contain all the information of a default account.
"""
for acct in self.wallet_in_mem.accounts:
if not isinst... | This interface is used to get the default account in WalletManager.
:return: an AccountData object that contain all the information of a default account. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/wallet/wallet_manager.py#L440-L451 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/abi/abi_info.py | AbiInfo.get_function | def get_function(self, name: str) -> AbiFunction or None:
"""
This interface is used to get an AbiFunction object from AbiInfo object by given function name.
:param name: the function name in abi file
:return: if succeed, an AbiFunction will constructed based on given function name
... | python | def get_function(self, name: str) -> AbiFunction or None:
"""
This interface is used to get an AbiFunction object from AbiInfo object by given function name.
:param name: the function name in abi file
:return: if succeed, an AbiFunction will constructed based on given function name
... | This interface is used to get an AbiFunction object from AbiInfo object by given function name.
:param name: the function name in abi file
:return: if succeed, an AbiFunction will constructed based on given function name | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/abi/abi_info.py#L17-L27 |
ontio/ontology-python-sdk | ontology/crypto/ecies.py | ECIES.__uncompress_public_key | def __uncompress_public_key(public_key: bytes) -> bytes:
"""
Uncompress the compressed public key.
:param public_key: compressed public key
:return: uncompressed public key
"""
is_even = public_key.startswith(b'\x02')
x = string_to_number(public_key[1:])
... | python | def __uncompress_public_key(public_key: bytes) -> bytes:
"""
Uncompress the compressed public key.
:param public_key: compressed public key
:return: uncompressed public key
"""
is_even = public_key.startswith(b'\x02')
x = string_to_number(public_key[1:])
... | Uncompress the compressed public key.
:param public_key: compressed public key
:return: uncompressed public key | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/crypto/ecies.py#L64-L83 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_version | def get_version(self, is_full: bool = False) -> dict or str:
"""
This interface is used to get the version information of the connected node in current network.
Return:
the version information of the connected node.
"""
payload = self.generate_json_rpc_payload(RpcMet... | python | def get_version(self, is_full: bool = False) -> dict or str:
"""
This interface is used to get the version information of the connected node in current network.
Return:
the version information of the connected node.
"""
payload = self.generate_json_rpc_payload(RpcMet... | This interface is used to get the version information of the connected node in current network.
Return:
the version information of the connected node. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L152-L163 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_connection_count | def get_connection_count(self, is_full: bool = False) -> int:
"""
This interface is used to get the current number of connections for the node in current network.
Return:
the number of connections.
"""
payload = self.generate_json_rpc_payload(RpcMethod.GET_NODE_COUNT... | python | def get_connection_count(self, is_full: bool = False) -> int:
"""
This interface is used to get the current number of connections for the node in current network.
Return:
the number of connections.
"""
payload = self.generate_json_rpc_payload(RpcMethod.GET_NODE_COUNT... | This interface is used to get the current number of connections for the node in current network.
Return:
the number of connections. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L165-L176 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_gas_price | def get_gas_price(self, is_full: bool = False) -> int or dict:
"""
This interface is used to get the gas price in current network.
Return:
the value of gas price.
"""
payload = self.generate_json_rpc_payload(RpcMethod.GET_GAS_PRICE)
response = self.__post(sel... | python | def get_gas_price(self, is_full: bool = False) -> int or dict:
"""
This interface is used to get the gas price in current network.
Return:
the value of gas price.
"""
payload = self.generate_json_rpc_payload(RpcMethod.GET_GAS_PRICE)
response = self.__post(sel... | This interface is used to get the gas price in current network.
Return:
the value of gas price. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L178-L189 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_network_id | def get_network_id(self, is_full: bool = False) -> int:
"""
This interface is used to get the network id of current network.
Return:
the network id of current network.
"""
payload = self.generate_json_rpc_payload(RpcMethod.GET_NETWORK_ID)
response = self.__p... | python | def get_network_id(self, is_full: bool = False) -> int:
"""
This interface is used to get the network id of current network.
Return:
the network id of current network.
"""
payload = self.generate_json_rpc_payload(RpcMethod.GET_NETWORK_ID)
response = self.__p... | This interface is used to get the network id of current network.
Return:
the network id of current network. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L191-L203 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_block_by_hash | def get_block_by_hash(self, block_hash: str, is_full: bool = False) -> dict:
"""
This interface is used to get the hexadecimal hash value of specified block height in current network.
:param block_hash: a hexadecimal value of block hash.
:param is_full:
:return: the block inform... | python | def get_block_by_hash(self, block_hash: str, is_full: bool = False) -> dict:
"""
This interface is used to get the hexadecimal hash value of specified block height in current network.
:param block_hash: a hexadecimal value of block hash.
:param is_full:
:return: the block inform... | This interface is used to get the hexadecimal hash value of specified block height in current network.
:param block_hash: a hexadecimal value of block hash.
:param is_full:
:return: the block information of the specified block hash. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L205-L217 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_block_by_height | def get_block_by_height(self, height: int, is_full: bool = False) -> dict:
"""
This interface is used to get the block information by block height in current network.
Return:
the decimal total number of blocks in current network.
"""
payload = self.generate_json_rpc_... | python | def get_block_by_height(self, height: int, is_full: bool = False) -> dict:
"""
This interface is used to get the block information by block height in current network.
Return:
the decimal total number of blocks in current network.
"""
payload = self.generate_json_rpc_... | This interface is used to get the block information by block height in current network.
Return:
the decimal total number of blocks in current network. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L219-L230 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_block_count | def get_block_count(self, is_full: bool = False) -> int or dict:
"""
This interface is used to get the decimal block number in current network.
Return:
the decimal total number of blocks in current network.
"""
payload = self.generate_json_rpc_payload(RpcMethod.GET_B... | python | def get_block_count(self, is_full: bool = False) -> int or dict:
"""
This interface is used to get the decimal block number in current network.
Return:
the decimal total number of blocks in current network.
"""
payload = self.generate_json_rpc_payload(RpcMethod.GET_B... | This interface is used to get the decimal block number in current network.
Return:
the decimal total number of blocks in current network. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L232-L243 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_block_height | def get_block_height(self, is_full: bool = False) -> int or dict:
"""
This interface is used to get the decimal block height in current network.
Return:
the decimal total height of blocks in current network.
"""
response = self.get_block_count(is_full=True)
r... | python | def get_block_height(self, is_full: bool = False) -> int or dict:
"""
This interface is used to get the decimal block height in current network.
Return:
the decimal total height of blocks in current network.
"""
response = self.get_block_count(is_full=True)
r... | This interface is used to get the decimal block height in current network.
Return:
the decimal total height of blocks in current network. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L245-L256 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_current_block_hash | def get_current_block_hash(self, is_full: bool = False) -> str:
"""
This interface is used to get the hexadecimal hash value of the highest block in current network.
Return:
the hexadecimal hash value of the highest block in current network.
"""
payload = self.genera... | python | def get_current_block_hash(self, is_full: bool = False) -> str:
"""
This interface is used to get the hexadecimal hash value of the highest block in current network.
Return:
the hexadecimal hash value of the highest block in current network.
"""
payload = self.genera... | This interface is used to get the hexadecimal hash value of the highest block in current network.
Return:
the hexadecimal hash value of the highest block in current network. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L272-L283 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_block_hash_by_height | def get_block_hash_by_height(self, height: int, is_full: bool = False) -> str:
"""
This interface is used to get the hexadecimal hash value of specified block height in current network.
:param height: a decimal block height value.
:param is_full:
:return: the hexadecimal hash va... | python | def get_block_hash_by_height(self, height: int, is_full: bool = False) -> str:
"""
This interface is used to get the hexadecimal hash value of specified block height in current network.
:param height: a decimal block height value.
:param is_full:
:return: the hexadecimal hash va... | This interface is used to get the hexadecimal hash value of specified block height in current network.
:param height: a decimal block height value.
:param is_full:
:return: the hexadecimal hash value of the specified block height. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L285-L297 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_balance | def get_balance(self, b58_address: str, is_full: bool = False) -> dict:
"""
This interface is used to get the account balance of specified base58 encoded address in current network.
:param b58_address: a base58 encoded account address.
:param is_full:
:return: the value of accou... | python | def get_balance(self, b58_address: str, is_full: bool = False) -> dict:
"""
This interface is used to get the account balance of specified base58 encoded address in current network.
:param b58_address: a base58 encoded account address.
:param is_full:
:return: the value of accou... | This interface is used to get the account balance of specified base58 encoded address in current network.
:param b58_address: a base58 encoded account address.
:param is_full:
:return: the value of account balance in dictionary form. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L299-L311 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_allowance | def get_allowance(self, asset_name: str, from_address: str, to_address: str, is_full: bool = False) -> str:
"""
This interface is used to get the the allowance
from transfer-from account to transfer-to account in current network.
:param asset_name:
:param from_address: a base58 ... | python | def get_allowance(self, asset_name: str, from_address: str, to_address: str, is_full: bool = False) -> str:
"""
This interface is used to get the the allowance
from transfer-from account to transfer-to account in current network.
:param asset_name:
:param from_address: a base58 ... | This interface is used to get the the allowance
from transfer-from account to transfer-to account in current network.
:param asset_name:
:param from_address: a base58 encoded account address.
:param to_address: a base58 encoded account address.
:param is_full:
:return: t... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L320-L335 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_storage | def get_storage(self, hex_contract_address: str, hex_key: str, is_full: bool = False) -> str:
"""
This interface is used to get the corresponding stored value
based on hexadecimal contract address and stored key.
:param hex_contract_address: hexadecimal contract address.
:param ... | python | def get_storage(self, hex_contract_address: str, hex_key: str, is_full: bool = False) -> str:
"""
This interface is used to get the corresponding stored value
based on hexadecimal contract address and stored key.
:param hex_contract_address: hexadecimal contract address.
:param ... | This interface is used to get the corresponding stored value
based on hexadecimal contract address and stored key.
:param hex_contract_address: hexadecimal contract address.
:param hex_key: a hexadecimal stored key.
:param is_full:
:return: the information of contract storage. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L337-L351 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_smart_contract_event_by_tx_hash | def get_smart_contract_event_by_tx_hash(self, tx_hash: str, is_full: bool = False) -> dict:
"""
This interface is used to get the corresponding smart contract event based on the height of block.
:param tx_hash: a hexadecimal hash value.
:param is_full:
:return: the information o... | python | def get_smart_contract_event_by_tx_hash(self, tx_hash: str, is_full: bool = False) -> dict:
"""
This interface is used to get the corresponding smart contract event based on the height of block.
:param tx_hash: a hexadecimal hash value.
:param is_full:
:return: the information o... | This interface is used to get the corresponding smart contract event based on the height of block.
:param tx_hash: a hexadecimal hash value.
:param is_full:
:return: the information of smart contract event in dictionary form. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L353-L365 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_smart_contract_event_by_height | def get_smart_contract_event_by_height(self, height: int, is_full: bool = False) -> List[dict]:
"""
This interface is used to get the corresponding smart contract event based on the height of block.
:param height: a decimal height value.
:param is_full:
:return: the information ... | python | def get_smart_contract_event_by_height(self, height: int, is_full: bool = False) -> List[dict]:
"""
This interface is used to get the corresponding smart contract event based on the height of block.
:param height: a decimal height value.
:param is_full:
:return: the information ... | This interface is used to get the corresponding smart contract event based on the height of block.
:param height: a decimal height value.
:param is_full:
:return: the information of smart contract event in dictionary form. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L367-L382 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_transaction_by_tx_hash | def get_transaction_by_tx_hash(self, tx_hash: str, is_full: bool = False) -> dict:
"""
This interface is used to get the corresponding transaction information based on the specified hash value.
:param tx_hash: str, a hexadecimal hash value.
:param is_full:
:return: dict
... | python | def get_transaction_by_tx_hash(self, tx_hash: str, is_full: bool = False) -> dict:
"""
This interface is used to get the corresponding transaction information based on the specified hash value.
:param tx_hash: str, a hexadecimal hash value.
:param is_full:
:return: dict
... | This interface is used to get the corresponding transaction information based on the specified hash value.
:param tx_hash: str, a hexadecimal hash value.
:param is_full:
:return: dict | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L387-L399 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_smart_contract | def get_smart_contract(self, hex_contract_address: str, is_full: bool = False) -> dict:
"""
This interface is used to get the information of smart contract based on the specified hexadecimal hash value.
:param hex_contract_address: str, a hexadecimal hash value.
:param is_full:
... | python | def get_smart_contract(self, hex_contract_address: str, is_full: bool = False) -> dict:
"""
This interface is used to get the information of smart contract based on the specified hexadecimal hash value.
:param hex_contract_address: str, a hexadecimal hash value.
:param is_full:
... | This interface is used to get the information of smart contract based on the specified hexadecimal hash value.
:param hex_contract_address: str, a hexadecimal hash value.
:param is_full:
:return: the information of smart contract in dictionary form. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L401-L417 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.get_merkle_proof | def get_merkle_proof(self, tx_hash: str, is_full: bool = False) -> dict:
"""
This interface is used to get the corresponding merkle proof based on the specified hexadecimal hash value.
:param tx_hash: an hexadecimal transaction hash value.
:param is_full:
:return: the merkle pro... | python | def get_merkle_proof(self, tx_hash: str, is_full: bool = False) -> dict:
"""
This interface is used to get the corresponding merkle proof based on the specified hexadecimal hash value.
:param tx_hash: an hexadecimal transaction hash value.
:param is_full:
:return: the merkle pro... | This interface is used to get the corresponding merkle proof based on the specified hexadecimal hash value.
:param tx_hash: an hexadecimal transaction hash value.
:param is_full:
:return: the merkle proof in dictionary form. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L419-L431 |
ontio/ontology-python-sdk | ontology/network/rpc.py | RpcClient.send_raw_transaction | def send_raw_transaction(self, tx: Transaction, is_full: bool = False) -> str:
"""
This interface is used to send the transaction into the network.
:param tx: Transaction object in ontology Python SDK.
:param is_full:
:return: a hexadecimal transaction hash value.
"""
... | python | def send_raw_transaction(self, tx: Transaction, is_full: bool = False) -> str:
"""
This interface is used to send the transaction into the network.
:param tx: Transaction object in ontology Python SDK.
:param is_full:
:return: a hexadecimal transaction hash value.
"""
... | This interface is used to send the transaction into the network.
:param tx: Transaction object in ontology Python SDK.
:param is_full:
:return: a hexadecimal transaction hash value. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/network/rpc.py#L447-L459 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.parse_ddo | def parse_ddo(ont_id: str, serialized_ddo: str or bytes) -> dict:
"""
This interface is used to deserialize a hexadecimal string into a DDO object in the from of dict.
:param ont_id: the unique ID for identity.
:param serialized_ddo: an serialized description object of ONT ID in form of... | python | def parse_ddo(ont_id: str, serialized_ddo: str or bytes) -> dict:
"""
This interface is used to deserialize a hexadecimal string into a DDO object in the from of dict.
:param ont_id: the unique ID for identity.
:param serialized_ddo: an serialized description object of ONT ID in form of... | This interface is used to deserialize a hexadecimal string into a DDO object in the from of dict.
:param ont_id: the unique ID for identity.
:param serialized_ddo: an serialized description object of ONT ID in form of str or bytes.
:return: a description object of ONT ID in the from of dict. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L110-L146 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.get_ddo | def get_ddo(self, ont_id: str) -> dict:
"""
This interface is used to get a DDO object in the from of dict.
:param ont_id: the unique ID for identity.
:return: a description object of ONT ID in the from of dict.
"""
args = dict(ontid=ont_id.encode('utf-8'))
invok... | python | def get_ddo(self, ont_id: str) -> dict:
"""
This interface is used to get a DDO object in the from of dict.
:param ont_id: the unique ID for identity.
:return: a description object of ONT ID in the from of dict.
"""
args = dict(ontid=ont_id.encode('utf-8'))
invok... | This interface is used to get a DDO object in the from of dict.
:param ont_id: the unique ID for identity.
:return: a description object of ONT ID in the from of dict. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L171-L184 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.registry_ont_id | def registry_ont_id(self, ont_id: str, ctrl_acct: Account, payer: Account, gas_limit: int, gas_price: int):
"""
This interface is used to send a Transaction object which is used to registry ontid.
:param ont_id: OntId.
:param ctrl_acct: an Account object which indicate who will sign for... | python | def registry_ont_id(self, ont_id: str, ctrl_acct: Account, payer: Account, gas_limit: int, gas_price: int):
"""
This interface is used to send a Transaction object which is used to registry ontid.
:param ont_id: OntId.
:param ctrl_acct: an Account object which indicate who will sign for... | This interface is used to send a Transaction object which is used to registry ontid.
:param ont_id: OntId.
:param ctrl_acct: an Account object which indicate who will sign for the transaction.
:param payer: an Account object which indicate who will pay for the transaction.
:param gas_li... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L187-L205 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.add_public_key | def add_public_key(self, ont_id: str, operator: Account, hex_new_public_key: str, payer: Account, gas_limit: int,
gas_price: int, is_recovery: bool = False):
"""
This interface is used to send a Transaction object which is used to add public key.
:param ont_id: OntId.
... | python | def add_public_key(self, ont_id: str, operator: Account, hex_new_public_key: str, payer: Account, gas_limit: int,
gas_price: int, is_recovery: bool = False):
"""
This interface is used to send a Transaction object which is used to add public key.
:param ont_id: OntId.
... | This interface is used to send a Transaction object which is used to add public key.
:param ont_id: OntId.
:param operator: an Account object which indicate who will sign for the transaction.
:param hex_new_public_key: the new hexadecimal public key in the form of string.
:param payer: ... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L208-L233 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.add_attribute | def add_attribute(self, ont_id: str, ctrl_acct: Account, attributes: Attribute, payer: Account, gas_limit: int,
gas_price: int) -> str:
"""
This interface is used to send a Transaction object which is used to add attribute.
:param ont_id: OntId.
:param ctrl_acct: a... | python | def add_attribute(self, ont_id: str, ctrl_acct: Account, attributes: Attribute, payer: Account, gas_limit: int,
gas_price: int) -> str:
"""
This interface is used to send a Transaction object which is used to add attribute.
:param ont_id: OntId.
:param ctrl_acct: a... | This interface is used to send a Transaction object which is used to add attribute.
:param ont_id: OntId.
:param ctrl_acct: an Account object which indicate who will sign for the transaction.
:param attributes: a list of attributes we want to add.
:param payer: an Account object which i... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L264-L285 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.remove_attribute | def remove_attribute(self, ont_id: str, operator: Account, attrib_key: str, payer: Account, gas_limit: int,
gas_price: int):
"""
This interface is used to send a Transaction object which is used to remove attribute.
:param ont_id: OntId.
:param operator: an Acco... | python | def remove_attribute(self, ont_id: str, operator: Account, attrib_key: str, payer: Account, gas_limit: int,
gas_price: int):
"""
This interface is used to send a Transaction object which is used to remove attribute.
:param ont_id: OntId.
:param operator: an Acco... | This interface is used to send a Transaction object which is used to remove attribute.
:param ont_id: OntId.
:param operator: an Account object which indicate who will sign for the transaction.
:param attrib_key: a string which is used to indicate which attribute we want to remove.
:par... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L288-L306 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.add_recovery | def add_recovery(self, ont_id: str, ctrl_acct: Account, b58_recovery_address: str, payer: Account, gas_limit: int,
gas_price: int):
"""
This interface is used to send a Transaction object which is used to add the recovery.
:param ont_id: OntId.
:param ctrl_acct: an ... | python | def add_recovery(self, ont_id: str, ctrl_acct: Account, b58_recovery_address: str, payer: Account, gas_limit: int,
gas_price: int):
"""
This interface is used to send a Transaction object which is used to add the recovery.
:param ont_id: OntId.
:param ctrl_acct: an ... | This interface is used to send a Transaction object which is used to add the recovery.
:param ont_id: OntId.
:param ctrl_acct: an Account object which indicate who will sign for the transaction.
:param b58_recovery_address: a base58 encode address which indicate who is the recovery.
:pa... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L309-L329 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.new_registry_ont_id_transaction | def new_registry_ont_id_transaction(self, ont_id: str, pub_key: str or bytes, b58_payer_address: str,
gas_limit: int, gas_price: int) -> Transaction:
"""
This interface is used to generate a Transaction object which is used to register ONT ID.
:param ont_... | python | def new_registry_ont_id_transaction(self, ont_id: str, pub_key: str or bytes, b58_payer_address: str,
gas_limit: int, gas_price: int) -> Transaction:
"""
This interface is used to generate a Transaction object which is used to register ONT ID.
:param ont_... | This interface is used to generate a Transaction object which is used to register ONT ID.
:param ont_id: OntId.
:param pub_key: the hexadecimal public key in the form of string.
:param b58_payer_address: a base58 encode address which indicate who will pay for the transaction.
:param gas... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L386-L406 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.new_add_public_key_transaction | def new_add_public_key_transaction(self, ont_id: str, bytes_operator: bytes, new_pub_key: str or bytes,
b58_payer_address: str, gas_limit: int, gas_price: int,
is_recovery: bool = False):
"""
This interface is used to send a T... | python | def new_add_public_key_transaction(self, ont_id: str, bytes_operator: bytes, new_pub_key: str or bytes,
b58_payer_address: str, gas_limit: int, gas_price: int,
is_recovery: bool = False):
"""
This interface is used to send a T... | This interface is used to send a Transaction object which is used to add public key.
:param ont_id: OntId.
:param bytes_operator: operator args in from of bytes.
:param new_pub_key: the new hexadecimal public key in the form of string.
:param b58_payer_address: a base58 encode address w... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L409-L435 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.new_revoke_public_key_transaction | def new_revoke_public_key_transaction(self, ont_id: str, bytes_operator: bytes, revoked_pub_key: str or bytes,
b58_payer_address: str, gas_limit: int, gas_price: int):
"""
This interface is used to generate a Transaction object which is used to remove public key... | python | def new_revoke_public_key_transaction(self, ont_id: str, bytes_operator: bytes, revoked_pub_key: str or bytes,
b58_payer_address: str, gas_limit: int, gas_price: int):
"""
This interface is used to generate a Transaction object which is used to remove public key... | This interface is used to generate a Transaction object which is used to remove public key.
:param ont_id: OntId.
:param bytes_operator: operator args in from of bytes.
:param revoked_pub_key: a public key string which will be removed.
:param b58_payer_address: a base58 encode address w... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L438-L460 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.new_add_attribute_transaction | def new_add_attribute_transaction(self, ont_id: str, pub_key: str or bytes, attributes: Attribute,
b58_payer_address: str, gas_limit: int, gas_price: int):
"""
This interface is used to generate a Transaction object which is used to add attribute.
:param on... | python | def new_add_attribute_transaction(self, ont_id: str, pub_key: str or bytes, attributes: Attribute,
b58_payer_address: str, gas_limit: int, gas_price: int):
"""
This interface is used to generate a Transaction object which is used to add attribute.
:param on... | This interface is used to generate a Transaction object which is used to add attribute.
:param ont_id: OntId.
:param pub_key: the hexadecimal public key in the form of string.
:param attributes: a list of attributes we want to add.
:param b58_payer_address: a base58 encode address which... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L463-L488 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.new_remove_attribute_transaction | def new_remove_attribute_transaction(self, ont_id: str, pub_key: str or bytes, attrib_key: str,
b58_payer_address: str, gas_limit: int, gas_price: int):
"""
This interface is used to generate a Transaction object which is used to remove attribute.
:param... | python | def new_remove_attribute_transaction(self, ont_id: str, pub_key: str or bytes, attrib_key: str,
b58_payer_address: str, gas_limit: int, gas_price: int):
"""
This interface is used to generate a Transaction object which is used to remove attribute.
:param... | This interface is used to generate a Transaction object which is used to remove attribute.
:param ont_id: OntId.
:param pub_key: the hexadecimal public key in the form of string.
:param attrib_key: a string which is used to indicate which attribute we want to remove.
:param b58_payer_ad... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L491-L512 |
ontio/ontology-python-sdk | ontology/smart_contract/native_contract/ontid.py | OntId.new_add_recovery_transaction | def new_add_recovery_transaction(self, ont_id: str, pub_key: str or bytes, b58_recovery_address: str,
b58_payer_address: str, gas_limit: int, gas_price: int):
"""
This interface is used to generate a Transaction object which is used to add the recovery.
:par... | python | def new_add_recovery_transaction(self, ont_id: str, pub_key: str or bytes, b58_recovery_address: str,
b58_payer_address: str, gas_limit: int, gas_price: int):
"""
This interface is used to generate a Transaction object which is used to add the recovery.
:par... | This interface is used to generate a Transaction object which is used to add the recovery.
:param ont_id: OntId.
:param pub_key: the hexadecimal public key in the form of string.
:param b58_recovery_address: a base58 encode address which indicate who is the recovery.
:param b58_payer_ad... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/native_contract/ontid.py#L515-L537 |
ontio/ontology-python-sdk | ontology/core/transaction.py | Transaction.sign_transaction | def sign_transaction(self, signer: Account):
"""
This interface is used to sign the transaction.
:param signer: an Account object which will sign the transaction.
:return: a Transaction object which has been signed.
"""
tx_hash = self.hash256()
sig_data = signer.... | python | def sign_transaction(self, signer: Account):
"""
This interface is used to sign the transaction.
:param signer: an Account object which will sign the transaction.
:return: a Transaction object which has been signed.
"""
tx_hash = self.hash256()
sig_data = signer.... | This interface is used to sign the transaction.
:param signer: an Account object which will sign the transaction.
:return: a Transaction object which has been signed. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/core/transaction.py#L137-L147 |
ontio/ontology-python-sdk | ontology/core/transaction.py | Transaction.add_sign_transaction | def add_sign_transaction(self, signer: Account):
"""
This interface is used to add signature into the transaction.
:param signer: an Account object which will sign the transaction.
:return: a Transaction object which has been signed.
"""
if self.sig_list is None or len(s... | python | def add_sign_transaction(self, signer: Account):
"""
This interface is used to add signature into the transaction.
:param signer: an Account object which will sign the transaction.
:return: a Transaction object which has been signed.
"""
if self.sig_list is None or len(s... | This interface is used to add signature into the transaction.
:param signer: an Account object which will sign the transaction.
:return: a Transaction object which has been signed. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/core/transaction.py#L149-L163 |
ontio/ontology-python-sdk | ontology/core/transaction.py | Transaction.add_multi_sign_transaction | def add_multi_sign_transaction(self, m: int, pub_keys: List[bytes] or List[str], signer: Account):
"""
This interface is used to generate an Transaction object which has multi signature.
:param tx: a Transaction object which will be signed.
:param m: the amount of signer.
:param... | python | def add_multi_sign_transaction(self, m: int, pub_keys: List[bytes] or List[str], signer: Account):
"""
This interface is used to generate an Transaction object which has multi signature.
:param tx: a Transaction object which will be signed.
:param m: the amount of signer.
:param... | This interface is used to generate an Transaction object which has multi signature.
:param tx: a Transaction object which will be signed.
:param m: the amount of signer.
:param pub_keys: a list of public keys.
:param signer: an Account object which will sign the transaction.
:re... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/core/transaction.py#L165-L195 |
ontio/ontology-python-sdk | ontology/io/memory_stream.py | StreamManager.get_stream | def get_stream(data=None):
"""
Get a MemoryStream instance.
Args:
data (bytes, bytearray, BytesIO): (Optional) data to create the stream from.
Returns:
MemoryStream: instance.
"""
if len(__mstreams_available__) == 0:
if data:
... | python | def get_stream(data=None):
"""
Get a MemoryStream instance.
Args:
data (bytes, bytearray, BytesIO): (Optional) data to create the stream from.
Returns:
MemoryStream: instance.
"""
if len(__mstreams_available__) == 0:
if data:
... | Get a MemoryStream instance.
Args:
data (bytes, bytearray, BytesIO): (Optional) data to create the stream from.
Returns:
MemoryStream: instance. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/memory_stream.py#L28-L55 |
ontio/ontology-python-sdk | ontology/common/address.py | Address.address_from_vm_code | def address_from_vm_code(code: str):
"""
generate contract address from avm bytecode.
:param code: str
:return: Address
"""
script_hash = Address.to_script_hash(bytearray.fromhex(code))[::-1]
return Address(script_hash) | python | def address_from_vm_code(code: str):
"""
generate contract address from avm bytecode.
:param code: str
:return: Address
"""
script_hash = Address.to_script_hash(bytearray.fromhex(code))[::-1]
return Address(script_hash) | generate contract address from avm bytecode.
:param code: str
:return: Address | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/common/address.py#L47-L54 |
ontio/ontology-python-sdk | ontology/account/account.py | Account.export_gcm_encrypted_private_key | def export_gcm_encrypted_private_key(self, password: str, salt: str, n: int = 16384) -> str:
"""
This interface is used to export an AES algorithm encrypted private key with the mode of GCM.
:param password: the secret pass phrase to generate the keys from.
:param salt: A string to use ... | python | def export_gcm_encrypted_private_key(self, password: str, salt: str, n: int = 16384) -> str:
"""
This interface is used to export an AES algorithm encrypted private key with the mode of GCM.
:param password: the secret pass phrase to generate the keys from.
:param salt: A string to use ... | This interface is used to export an AES algorithm encrypted private key with the mode of GCM.
:param password: the secret pass phrase to generate the keys from.
:param salt: A string to use for better protection from dictionary attacks.
This value does not need to be kept secret, ... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/account/account.py#L108-L130 |
ontio/ontology-python-sdk | ontology/account/account.py | Account.get_gcm_decoded_private_key | def get_gcm_decoded_private_key(encrypted_key_str: str, password: str, b58_address: str, salt: str, n: int,
scheme: SignatureScheme) -> str:
"""
This interface is used to decrypt an private key which has been encrypted.
:param encrypted_key_str: an gcm encryp... | python | def get_gcm_decoded_private_key(encrypted_key_str: str, password: str, b58_address: str, salt: str, n: int,
scheme: SignatureScheme) -> str:
"""
This interface is used to decrypt an private key which has been encrypted.
:param encrypted_key_str: an gcm encryp... | This interface is used to decrypt an private key which has been encrypted.
:param encrypted_key_str: an gcm encrypted private key in the form of string.
:param password: the secret pass phrase to generate the keys from.
:param b58_address: a base58 encode address which should be correspond with... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/account/account.py#L133-L162 |
ontio/ontology-python-sdk | ontology/account/account.py | Account.export_wif | def export_wif(self) -> str:
"""
This interface is used to get export ECDSA private key in the form of WIF which
is a way to encoding an ECDSA private key and make it easier to copy.
:return: a WIF encode private key.
"""
data = b''.join([b'\x80', self.__private_key, b'\... | python | def export_wif(self) -> str:
"""
This interface is used to get export ECDSA private key in the form of WIF which
is a way to encoding an ECDSA private key and make it easier to copy.
:return: a WIF encode private key.
"""
data = b''.join([b'\x80', self.__private_key, b'\... | This interface is used to get export ECDSA private key in the form of WIF which
is a way to encoding an ECDSA private key and make it easier to copy.
:return: a WIF encode private key. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/account/account.py#L216-L226 |
ontio/ontology-python-sdk | ontology/account/account.py | Account.get_private_key_from_wif | def get_private_key_from_wif(wif: str) -> bytes:
"""
This interface is used to decode a WIF encode ECDSA private key.
:param wif: a WIF encode private key.
:return: a ECDSA private key in the form of bytes.
"""
if wif is None or wif is "":
raise Exception("no... | python | def get_private_key_from_wif(wif: str) -> bytes:
"""
This interface is used to decode a WIF encode ECDSA private key.
:param wif: a WIF encode private key.
:return: a ECDSA private key in the form of bytes.
"""
if wif is None or wif is "":
raise Exception("no... | This interface is used to decode a WIF encode ECDSA private key.
:param wif: a WIF encode private key.
:return: a ECDSA private key in the form of bytes. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/account/account.py#L229-L245 |
ontio/ontology-python-sdk | ontology/crypto/kdf.py | pbkdf2 | def pbkdf2(seed: str or bytes, dk_len: int) -> bytes:
"""
Derive one key from a seed.
:param seed: the secret pass phrase to generate the keys from.
:param dk_len: the length in bytes of every derived key.
:return:
"""
key = b''
index = 1
bytes_seed = str_to_bytes(seed)
while le... | python | def pbkdf2(seed: str or bytes, dk_len: int) -> bytes:
"""
Derive one key from a seed.
:param seed: the secret pass phrase to generate the keys from.
:param dk_len: the length in bytes of every derived key.
:return:
"""
key = b''
index = 1
bytes_seed = str_to_bytes(seed)
while le... | Derive one key from a seed.
:param seed: the secret pass phrase to generate the keys from.
:param dk_len: the length in bytes of every derived key.
:return: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/crypto/kdf.py#L9-L23 |
ontio/ontology-python-sdk | ontology/core/program.py | ProgramBuilder.sort_public_keys | def sort_public_keys(pub_keys: List[bytes] or List[str]):
"""
:param pub_keys: a list of public keys in format of bytes.
:return: sorted public keys.
"""
for index, key in enumerate(pub_keys):
if isinstance(key, str):
pub_keys[index] = bytes.fromhex(ke... | python | def sort_public_keys(pub_keys: List[bytes] or List[str]):
"""
:param pub_keys: a list of public keys in format of bytes.
:return: sorted public keys.
"""
for index, key in enumerate(pub_keys):
if isinstance(key, str):
pub_keys[index] = bytes.fromhex(ke... | :param pub_keys: a list of public keys in format of bytes.
:return: sorted public keys. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/core/program.py#L94-L102 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/abi/abi_function.py | AbiFunction.set_params_value | def set_params_value(self, *params):
"""
This interface is used to set parameter value for an function in abi file.
"""
if len(params) != len(self.parameters):
raise Exception("parameter error")
temp = self.parameters
self.parameters = []
for i in rang... | python | def set_params_value(self, *params):
"""
This interface is used to set parameter value for an function in abi file.
"""
if len(params) != len(self.parameters):
raise Exception("parameter error")
temp = self.parameters
self.parameters = []
for i in rang... | This interface is used to set parameter value for an function in abi file. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/abi/abi_function.py#L12-L22 |
ontio/ontology-python-sdk | ontology/smart_contract/neo_contract/abi/abi_function.py | AbiFunction.get_parameter | def get_parameter(self, param_name: str) -> Parameter:
"""
This interface is used to get a Parameter object from an AbiFunction object
which contain given function parameter's name, type and value.
:param param_name: a string used to indicate which parameter we want to get from AbiFunct... | python | def get_parameter(self, param_name: str) -> Parameter:
"""
This interface is used to get a Parameter object from an AbiFunction object
which contain given function parameter's name, type and value.
:param param_name: a string used to indicate which parameter we want to get from AbiFunct... | This interface is used to get a Parameter object from an AbiFunction object
which contain given function parameter's name, type and value.
:param param_name: a string used to indicate which parameter we want to get from AbiFunction.
:return: a Parameter object which contain given function param... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/smart_contract/neo_contract/abi/abi_function.py#L24-L35 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.unpack | def unpack(self, fmt, length=1):
"""
Unpack the stream contents according to the specified format in `fmt`.
For more information about the `fmt` format see: https://docs.python.org/3/library/struct.html
Args:
fmt (str): format string.
length (int): amount of byte... | python | def unpack(self, fmt, length=1):
"""
Unpack the stream contents according to the specified format in `fmt`.
For more information about the `fmt` format see: https://docs.python.org/3/library/struct.html
Args:
fmt (str): format string.
length (int): amount of byte... | Unpack the stream contents according to the specified format in `fmt`.
For more information about the `fmt` format see: https://docs.python.org/3/library/struct.html
Args:
fmt (str): format string.
length (int): amount of bytes to read.
Returns:
variable: th... | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L37-L53 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_byte | def read_byte(self, do_ord=True) -> int:
"""
Read a single byte.
Args:
do_ord (bool): (default True) convert the byte to an ordinal first.
Returns:
bytes: a single byte if successful. 0 (int) if an exception occurred.
"""
try:
if do_ord... | python | def read_byte(self, do_ord=True) -> int:
"""
Read a single byte.
Args:
do_ord (bool): (default True) convert the byte to an ordinal first.
Returns:
bytes: a single byte if successful. 0 (int) if an exception occurred.
"""
try:
if do_ord... | Read a single byte.
Args:
do_ord (bool): (default True) convert the byte to an ordinal first.
Returns:
bytes: a single byte if successful. 0 (int) if an exception occurred. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L55-L69 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_bytes | def read_bytes(self, length) -> bytes:
"""
Read the specified number of bytes from the stream.
Args:
length (int): number of bytes to read.
Returns:
bytes: `length` number of bytes.
"""
value = self.stream.read(length)
return value | python | def read_bytes(self, length) -> bytes:
"""
Read the specified number of bytes from the stream.
Args:
length (int): number of bytes to read.
Returns:
bytes: `length` number of bytes.
"""
value = self.stream.read(length)
return value | Read the specified number of bytes from the stream.
Args:
length (int): number of bytes to read.
Returns:
bytes: `length` number of bytes. | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L71-L82 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_float | def read_float(self, little_endian=True):
"""
Read 4 bytes as a float value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
float:
"""
if little_endian:
endian = "<"
else:... | python | def read_float(self, little_endian=True):
"""
Read 4 bytes as a float value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
float:
"""
if little_endian:
endian = "<"
else:... | Read 4 bytes as a float value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
float: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L102-L116 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_double | def read_double(self, little_endian=True):
"""
Read 8 bytes as a double value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
float:
"""
if little_endian:
endian = "<"
els... | python | def read_double(self, little_endian=True):
"""
Read 8 bytes as a double value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
float:
"""
if little_endian:
endian = "<"
els... | Read 8 bytes as a double value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
float: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L118-L132 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_int8 | def read_int8(self, little_endian=True):
"""
Read 1 byte as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | python | def read_int8(self, little_endian=True):
"""
Read 1 byte as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | Read 1 byte as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L134-L148 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_uint8 | def read_uint8(self, little_endian=True):
"""
Read 1 byte as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | python | def read_uint8(self, little_endian=True):
"""
Read 1 byte as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | Read 1 byte as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L150-L164 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_int16 | def read_int16(self, little_endian=True):
"""
Read 2 byte as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | python | def read_int16(self, little_endian=True):
"""
Read 2 byte as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | Read 2 byte as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L166-L180 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_uint16 | def read_uint16(self, little_endian=True):
"""
Read 2 byte as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | python | def read_uint16(self, little_endian=True):
"""
Read 2 byte as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | Read 2 byte as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L182-L196 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_int32 | def read_int32(self, little_endian=True):
"""
Read 4 bytes as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | python | def read_int32(self, little_endian=True):
"""
Read 4 bytes as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | Read 4 bytes as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L198-L212 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_uint32 | def read_uint32(self, little_endian=True):
"""
Read 4 bytes as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | python | def read_uint32(self, little_endian=True):
"""
Read 4 bytes as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | Read 4 bytes as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L214-L228 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_int64 | def read_int64(self, little_endian=True):
"""
Read 8 bytes as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | python | def read_int64(self, little_endian=True):
"""
Read 8 bytes as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | Read 8 bytes as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L230-L244 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_uint64 | def read_uint64(self, little_endian=True):
"""
Read 8 bytes as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | python | def read_uint64(self, little_endian=True):
"""
Read 8 bytes as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... | Read 8 bytes as an unsigned integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L246-L260 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_var_int | def read_var_int(self, max_size=sys.maxsize):
"""
Read a variable length integer from the stream.
The NEO network protocol supports encoded storage for space saving. See: http://docs.neo.org/en-us/node/network-protocol.html#convention
Args:
max_size (int): (Optional) maximum... | python | def read_var_int(self, max_size=sys.maxsize):
"""
Read a variable length integer from the stream.
The NEO network protocol supports encoded storage for space saving. See: http://docs.neo.org/en-us/node/network-protocol.html#convention
Args:
max_size (int): (Optional) maximum... | Read a variable length integer from the stream.
The NEO network protocol supports encoded storage for space saving. See: http://docs.neo.org/en-us/node/network-protocol.html#convention
Args:
max_size (int): (Optional) maximum number of bytes to read.
Returns:
int: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L262-L286 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_var_bytes | def read_var_bytes(self, max_size=sys.maxsize) -> bytes:
"""
Read a variable length of bytes from the stream.
Args:
max_size (int): (Optional) maximum number of bytes to read.
Returns:
bytes:
"""
length = self.read_var_int(max_size)
retur... | python | def read_var_bytes(self, max_size=sys.maxsize) -> bytes:
"""
Read a variable length of bytes from the stream.
Args:
max_size (int): (Optional) maximum number of bytes to read.
Returns:
bytes:
"""
length = self.read_var_int(max_size)
retur... | Read a variable length of bytes from the stream.
Args:
max_size (int): (Optional) maximum number of bytes to read.
Returns:
bytes: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L288-L299 |
ontio/ontology-python-sdk | ontology/io/binary_reader.py | BinaryReader.read_str | def read_str(self):
"""
Read a string from the stream.
Returns:
str:
"""
length = self.read_uint8()
return self.unpack(str(length) + 's', length) | python | def read_str(self):
"""
Read a string from the stream.
Returns:
str:
"""
length = self.read_uint8()
return self.unpack(str(length) + 's', length) | Read a string from the stream.
Returns:
str: | https://github.com/ontio/ontology-python-sdk/blob/ac88bdda941896c5d2ced08422a9c5179d3f9b19/ontology/io/binary_reader.py#L301-L309 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.