INSTRUCTION
stringlengths
1
46.3k
RESPONSE
stringlengths
75
80.2k
Returns Place predictions given a textual search query, such as "pizza near New York", and optional geographic bounds. :param input_text: The text query on which to search. :type input_text: string :param offset: The position, in the input term, of the last character that the service uses to m...
def places_autocomplete_query(client, input_text, offset=None, location=None, radius=None, language=None): """ Returns Place predictions given a textual search query, such as "pizza near New York", and optional geographic bounds. :param input_text: The text query on which ...
Internal handler for ``autocomplete`` and ``autocomplete_query``. See each method's docs for arg details.
def _autocomplete(client, url_part, input_text, session_token=None, offset=None, location=None, radius=None, language=None, types=None, components=None, strict_bounds=False): """ Internal handler for ``autocomplete`` and ``autocomplete_query``. See each method's docs for ...
Mimics the exception handling logic in ``client._get_body``, but for geolocation which uses a different response format.
def _geolocation_extract(response): """ Mimics the exception handling logic in ``client._get_body``, but for geolocation which uses a different response format. """ body = response.json() if response.status_code in (200, 404): return body try: error = body["error"]["errors"]...
The Google Maps Geolocation API returns a location and accuracy radius based on information about cell towers and WiFi nodes given. See https://developers.google.com/maps/documentation/geolocation/intro for more info, including more detail for each parameter below. :param home_mobile_country_code: The...
def geolocate(client, home_mobile_country_code=None, home_mobile_network_code=None, radio_type=None, carrier=None, consider_ip=None, cell_towers=None, wifi_access_points=None): """ The Google Maps Geolocation API returns a location and accuracy radius based on information about c...
Provides a single entry point for modifying all API methods. For now this is limited to allowing the client object to be modified with an `extra_params` keyword arg to each method, that is then used as the params for each web service request. Please note that this is an unsupported feature for advanced...
def make_api_method(func): """ Provides a single entry point for modifying all API methods. For now this is limited to allowing the client object to be modified with an `extra_params` keyword arg to each method, that is then used as the params for each web service request. Please note that this...
Returns a base64-encoded HMAC-SHA1 signature of a given string. :param secret: The key used for the signature, base64 encoded. :type secret: string :param payload: The payload to sign. :type payload: string :rtype: string
def sign_hmac(secret, payload): """Returns a base64-encoded HMAC-SHA1 signature of a given string. :param secret: The key used for the signature, base64 encoded. :type secret: string :param payload: The payload to sign. :type payload: string :rtype: string """ payload = payload.encode...
URL encodes the parameters. :param params: The parameters :type params: list of key/value tuples. :rtype: string
def urlencode_params(params): """URL encodes the parameters. :param params: The parameters :type params: list of key/value tuples. :rtype: string """ # urlencode does not handle unicode strings in Python 2. # Firstly, normalize the values so they get encoded correctly. params = [(key, ...
Performs HTTP GET/POST with credentials, returning the body as JSON. :param url: URL path for the request. Should begin with a slash. :type url: string :param params: HTTP GET parameters. :type params: dict or list of key/value tuples :param first_request_time: The tim...
def _request(self, url, params, first_request_time=None, retry_counter=0, base_url=_DEFAULT_BASE_URL, accepts_clientid=True, extract_body=None, requests_kwargs=None, post_json=None): """Performs HTTP GET/POST with credentials, returning the body as JSON. :param url: UR...
Returns the path and query string portion of the request URL, first adding any necessary parameters. :param path: The path portion of the URL. :type path: string :param params: URL parameters. :type params: dict or list of key/value tuples :rtype: string
def _generate_auth_url(self, path, params, accepts_clientid): """Returns the path and query string portion of the request URL, first adding any necessary parameters. :param path: The path portion of the URL. :type path: string :param params: URL parameters. :type params...
Run all jobs that are scheduled to run. Please note that it is *intended behavior that run_pending() does not run missed jobs*. For example, if you've registered a job that should run every minute and you only call run_pending() in one hour increments then your job won't be run 60 times...
def run_pending(self): """ Run all jobs that are scheduled to run. Please note that it is *intended behavior that run_pending() does not run missed jobs*. For example, if you've registered a job that should run every minute and you only call run_pending() in one hour inc...
Run all jobs regardless if they are scheduled to run or not. A delay of `delay` seconds is added between each job. This helps distribute system load generated by the jobs more evenly over time. :param delay_seconds: A delay added between every executed job
def run_all(self, delay_seconds=0): """ Run all jobs regardless if they are scheduled to run or not. A delay of `delay` seconds is added between each job. This helps distribute system load generated by the jobs more evenly over time. :param delay_seconds: A delay added ...
Deletes scheduled jobs marked with the given tag, or all jobs if tag is omitted. :param tag: An identifier used to identify a subset of jobs to delete
def clear(self, tag=None): """ Deletes scheduled jobs marked with the given tag, or all jobs if tag is omitted. :param tag: An identifier used to identify a subset of jobs to delete """ if tag is None: del self.jobs[:] else: ...
Tags the job with one or more unique indentifiers. Tags must be hashable. Duplicate tags are discarded. :param tags: A unique list of ``Hashable`` tags. :return: The invoked job instance
def tag(self, *tags): """ Tags the job with one or more unique indentifiers. Tags must be hashable. Duplicate tags are discarded. :param tags: A unique list of ``Hashable`` tags. :return: The invoked job instance """ if not all(isinstance(tag, collections.Hashab...
Specify a particular time that the job should be run at. :param time_str: A string in one of the following formats: `HH:MM:SS`, `HH:MM`,`:MM`, `:SS`. The format must make sense given how often the job is repeating; for example, a job that repeats every minute should not be g...
def at(self, time_str): """ Specify a particular time that the job should be run at. :param time_str: A string in one of the following formats: `HH:MM:SS`, `HH:MM`,`:MM`, `:SS`. The format must make sense given how often the job is repeating; for example, a job that repe...
Specifies the job_func that should be called every time the job runs. Any additional arguments are passed on to job_func when the job runs. :param job_func: The function to be scheduled :return: The invoked job instance
def do(self, job_func, *args, **kwargs): """ Specifies the job_func that should be called every time the job runs. Any additional arguments are passed on to job_func when the job runs. :param job_func: The function to be scheduled :return: The invoked job instan...
Run the job and immediately reschedule it. :return: The return value returned by the `job_func`
def run(self): """ Run the job and immediately reschedule it. :return: The return value returned by the `job_func` """ logger.info('Running job %s', self) ret = self.job_func() self.last_run = datetime.datetime.now() self._schedule_next_run() retu...
Compute the instant when this job should run next.
def _schedule_next_run(self): """ Compute the instant when this job should run next. """ if self.unit not in ('seconds', 'minutes', 'hours', 'days', 'weeks'): raise ScheduleValueError('Invalid unit') if self.latest is not None: if not (self.latest >= self...
Creates a Class representing an Issuer Credential :param source_id: Tag associated by user of sdk :param attrs: attributes that will form the credential :param cred_def_handle: Handle from previously created credential def object :param name: Name given to the Credential ...
async def create(source_id: str, attrs: dict, cred_def_handle: int, name: str, price: str): """ Creates a Class representing an Issuer Credential :param source_id: Tag associated by user of sdk :param attrs: attributes that will form the credential :param cred_def...
Creates IssuerCredential object from a dict. :param data: dict representing a serialized IssuerCredential Object :return: IssuerCredential object Example: source_id = '1' cred_def_id = 'cred_def_id1' attrs = {'key': 'value', 'key2': 'value2', 'key...
async def deserialize(data: dict): """ Creates IssuerCredential object from a dict. :param data: dict representing a serialized IssuerCredential Object :return: IssuerCredential object Example: source_id = '1' cred_def_id = 'cred_def_id1' ...
Sends an offer to a prover. Once accepted, a request will be recieved. :param connection: vcx.api.connection.Connection :return: None Example: source_id = '1' cred_def_id = 'cred_def_id1' attrs = {'key': 'value', 'key2': 'value2', 'key3': 'value3'} name = 'Crede...
async def send_offer(self, connection: Connection): """ Sends an offer to a prover. Once accepted, a request will be recieved. :param connection: vcx.api.connection.Connection :return: None Example: source_id = '1' cred_def_id = 'cred_def_id1' attrs = {'...
Revokes a credential. :return: None Example: credential.revoke_credential()
async def revoke_credential(self): """ Revokes a credential. :return: None Example: credential.revoke_credential() """ if not hasattr(IssuerCredential.revoke_credential, "cb"): self.logger.debug("vcx_issuer_revoke_credential: Creating callback"...
Creates a new secure wallet with the given unique name. :param config: Wallet configuration json. { "id": string, Identifier of the wallet. Configured storage uses this identifier to lookup exact wallet data placement. "storage_type": optional<string>, Type of the wallet storage. De...
async def create_wallet(config: str, credentials: str) -> None: """ Creates a new secure wallet with the given unique name. :param config: Wallet configuration json. { "id": string, Identifier of the wallet. Configured storage uses this identifier to lookup ...
Closes opened wallet and frees allocated resources. :param handle: wallet handle returned by indy_open_wallet. :return: Error code
async def close_wallet(handle: int) -> None: """ Closes opened wallet and frees allocated resources. :param handle: wallet handle returned by indy_open_wallet. :return: Error code """ logger = logging.getLogger(__name__) logger.debug("close_wallet: >>> handle: %i", handle) if not hasa...
Exports opened wallet to the file. :param handle: wallet handle returned by indy_open_wallet. :param export_config_json: JSON containing settings for input operation. { "path": path of the file that contains exported wallet content "key": string, Key or passphrase used for wallet exp...
async def export_wallet(handle: int, export_config_json: str) -> None: """ Exports opened wallet to the file. :param handle: wallet handle returned by indy_open_wallet. :param export_config_json: JSON containing settings for input operation. { "path": path of th...
Creates a new secure wallet with the given unique name and then imports its content according to fields provided in import_config This can be seen as an indy_create_wallet call with additional content import :param config: Wallet configuration json. { "id": string, Identifier of the wallet. ...
async def import_wallet(config: str, credentials: str, import_config_json: str) -> None: """ Creates a new secure wallet with the given unique name and then imports its content according to fields provided in import_config This can be seen as an indy_creat...
Generate wallet master key. Returned key is compatible with "RAW" key derivation method. It allows to avoid expensive key derivation for use cases when wallet keys can be stored in a secure enclave. :param config: (optional) key configuration json. { "seed": string, (optional) Seed that allows...
async def generate_wallet_key(config: Optional[str]) -> str: """ Generate wallet master key. Returned key is compatible with "RAW" key derivation method. It allows to avoid expensive key derivation for use cases when wallet keys can be stored in a secure enclave. :param config: (optional) key confi...
Create credential schema entity that describes credential attributes list and allows credentials interoperability. Schema is public and intended to be shared with all anoncreds workflow actors usually by publishing SCHEMA transaction to Indy distributed ledger. It is IMPORTANT for current version POST...
async def issuer_create_schema(issuer_did: str, name: str, version: str, attrs: str) -> (str, str): """ Create credential schema entity that describes credential attributes list and allows credentials interoperabili...
Create credential definition entity that encapsulates credentials issuer DID, credential schema, secrets used for signing credentials and secrets used for credentials revocation. Credential definition entity contains private and public parts. Private part will be stored in the wallet. Public part will be r...
async def issuer_create_and_store_credential_def(wallet_handle: int, issuer_did: str, schema_json: str, tag: str, signature_...
Create a new revocation registry for the given credential definition as tuple of entities: - Revocation registry definition that encapsulates credentials definition reference, revocation type specific configuration and secrets used for credentials revocation - Revocation registry state that stores the inf...
async def issuer_create_and_store_revoc_reg(wallet_handle: int, issuer_did: str, revoc_def_type: Optional[str], tag: str, cred_def_id: str, ...
Create credential offer that will be used by Prover for credential request creation. Offer includes nonce and key correctness proof for authentication between protocol steps and integrity checking. :param wallet_handle: wallet handler (created by open_wallet). :param cred_def_id: id of credential defin...
async def issuer_create_credential_offer(wallet_handle: int, cred_def_id: str) -> str: """ Create credential offer that will be used by Prover for credential request creation. Offer includes nonce and key correctness proof for authentication between protocol step...
Check Cred Request for the given Cred Offer and issue Credential for the given Cred Request. Cred Request must match Cred Offer. The credential definition and revocation registry definition referenced in Cred Offer and Cred Request must be already created and stored into the wallet. Information for this c...
async def issuer_create_credential(wallet_handle: int, cred_offer_json: str, cred_req_json: str, cred_values_json: str, rev_reg_id: Optional[str], ...
Revoke a credential identified by a cred_revoc_id (returned by issuer_create_credential). The corresponding credential definition and revocation registry must be already created an stored into the wallet. This call returns revoc registry delta as json file intended to be shared as REVOC_REG_ENTRY transact...
async def issuer_revoke_credential(wallet_handle: int, blob_storage_reader_handle: int, rev_reg_id: str, cred_revoc_id: str) -> str: """ Revoke a credential identified by a cred_revoc_id (returned by issuer_...
Merge two revocation registry deltas (returned by issuer_create_credential or issuer_revoke_credential) to accumulate common delta. Send common delta to ledger to reduce the load. :param rev_reg_delta_json: revocation registry delta json :param other_rev_reg_delta_json: revocation registry delta for which ...
async def issuer_merge_revocation_registry_deltas(rev_reg_delta_json: str, other_rev_reg_delta_json: str) -> str: """ Merge two revocation registry deltas (returned by issuer_create_credential or issuer_revoke_credential) to accumulate common delta. Send com...
Creates a master secret with a given name and stores it in the wallet. The name must be unique. :param wallet_handle: wallet handler (created by open_wallet). :param master_secret_name: (optional, if not present random one will be generated) new master id :return: id of generated master secret.
async def prover_create_master_secret(wallet_handle: int, master_secret_name: Optional[str]) -> str: """ Creates a master secret with a given name and stores it in the wallet. The name must be unique. :param wallet_handle: wallet handler (created by open_wallet). ...
Creates a clam request for the given credential offer. The method creates a blinded master secret for a master secret identified by a provided name. The master secret identified by the name must be already stored in the secure wallet (see prover_create_master_secret) The blinded master secret is a part of ...
async def prover_create_credential_req(wallet_handle: int, prover_did: str, cred_offer_json: str, cred_def_json: str, master_secret_id: str) -> (str, str): """ ...
Check credential provided by Issuer for the given credential request, updates the credential by a master secret and stores in a secure wallet. To support efficient search the following tags will be created for stored credential: { "schema_id": <credential schema id>, "schema...
async def prover_store_credential(wallet_handle: int, cred_id: Optional[str], cred_req_metadata_json: str, cred_json: str, cred_def_json: str, rev_reg...
Gets human readable credential by the given id. :param wallet_handle: wallet handler (created by open_wallet). :param cred_id: Identifier by which requested credential is stored in the wallet :return: credential json { "referent": string, // cred_id in the wallet "attrs": {"key1":"r...
async def prover_get_credential(wallet_handle: int, cred_id: str) -> str: """ Gets human readable credential by the given id. :param wallet_handle: wallet handler (created by open_wallet). :param cred_id: Identifier by which requested credential is stored in the wallet ...
Gets human readable credentials according to the filter. If filter is NULL, then all credentials are returned. Credentials can be filtered by tags created during saving of credential. NOTE: This method is deprecated because immediately returns all fetched credentials. Use <prover_search_credentials> to...
async def prover_get_credentials(wallet_handle: int, filter_json: str) -> str: """ Gets human readable credentials according to the filter. If filter is NULL, then all credentials are returned. Credentials can be filtered by tags created during saving of credential. ...
Search for credentials stored in wallet. Credentials can be filtered by tags created during saving of credential. Instead of immediately returning of fetched credentials this call returns search_handle that can be used later to fetch records by small batches (with prover_credentials_search_fetch_records). ...
async def prover_search_credentials(wallet_handle: int, query_json: str) -> (int, int): """ Search for credentials stored in wallet. Credentials can be filtered by tags created during saving of credential. Instead of immediately returning of fetched credentials this ...
Fetch next credentials for search. :param search_handle: Search handle (created by prover_open_credentials_search) :param count: Count of records to fetch :return: credentials_json: List of credentials: [{ "referent": string, // cred_id in the wallet "attrs": {"key1":"raw_value1", "key2...
async def prover_fetch_credentials(search_handle: int, count: int) -> str: """ Fetch next credentials for search. :param search_handle: Search handle (created by prover_open_credentials_search) :param count: Count of records to fetch :return: credentials_json: Lis...
Close credentials search (make search handle invalid) :param search_handle: Search handle (created by prover_open_credentials_search) :return: None
async def prover_close_credentials_search(search_handle: int) -> None: """ Close credentials search (make search handle invalid) :param search_handle: Search handle (created by prover_open_credentials_search) :return: None """ logger = logging.getLogger(__name__) logger.debug("prover_close...
Gets human readable credentials matching the given proof request. NOTE: This method is deprecated because immediately returns all fetched credentials. Use <prover_search_credentials_for_proof_req> to fetch records by small batches. :param wallet_handle: wallet handler (created by open_wallet). :param ...
async def prover_get_credentials_for_proof_req(wallet_handle: int, proof_request_json: str) -> str: """ Gets human readable credentials matching the given proof request. NOTE: This method is deprecated because immediately returns all fetched credentials. U...
Search for credentials matching the given proof request. Instead of immediately returning of fetched credentials this call returns search_handle that can be used later to fetch records by small batches (with prover_fetch_credentials_for_proof_req). :param wallet_handle: wallet handler (created by open_wal...
async def prover_search_credentials_for_proof_req(wallet_handle: int, proof_request_json: str, extra_query_json: Optional[str]) -> int: """ Search for credentials matching the given proof request. Instead of...
Creates a proof according to the given proof request Either a corresponding credential with optionally revealed attributes or self-attested attribute must be provided for each requested attribute (see indy_prover_get_credentials_for_pool_req). A proof request may request multiple credentials from different ...
async def prover_create_proof(wallet_handle: int, proof_req_json: str, requested_credentials_json: str, master_secret_name: str, schemas_json: str, credential_defs_json: ...
Verifies a proof (of multiple credential). All required schemas, public keys and revocation registries must be provided. :param proof_request_json: { "name": string, "version": string, "nonce": string, "requested_attributes": { // set of requested a...
async def verifier_verify_proof(proof_request_json: str, proof_json: str, schemas_json: str, credential_defs_json: str, rev_reg_defs_json: str, rev_regs_json: s...
Create revocation state for a credential in the particular time moment. :param blob_storage_reader_handle: configuration of blob storage reader handle that will allow to read revocation tails :param rev_reg_def_json: revocation registry definition json :param rev_reg_delta_json: revocation registry definit...
async def create_revocation_state(blob_storage_reader_handle: int, rev_reg_def_json: str, rev_reg_delta_json: str, timestamp: int, cred_rev_id: str) -> str: """ Create revocati...
Signs and submits request message to validator pool. Adds submitter information to passed request json, signs it with submitter sign key (see wallet_sign), and sends signed request message to validator pool (see write_request). :param pool_handle: pool handle (created by open_pool_ledger). :param ...
async def sign_and_submit_request(pool_handle: int, wallet_handle: int, submitter_did: str, request_json: str) -> str: """ Signs and submits request message to validator pool. Adds submitter information to...
Publishes request message to validator pool (no signing, unlike sign_and_submit_request). The request is sent to the validator pool as is. It's assumed that it's already prepared. :param pool_handle: pool handle (created by open_pool_ledger). :param request_json: Request data json. :return: Request res...
async def submit_request(pool_handle: int, request_json: str) -> str: """ Publishes request message to validator pool (no signing, unlike sign_and_submit_request). The request is sent to the validator pool as is. It's assumed that it's already prepared. :param pool_handle: pool...
Send action to particular nodes of validator pool. The list of requests can be send: POOL_RESTART GET_VALIDATOR_INFO The request is sent to the nodes as is. It's assumed that it's already prepared. :param pool_handle: pool handle (created by open_pool_ledger). :param request_js...
async def submit_action(pool_handle: int, request_json: str, nodes: Optional[str], timeout: Optional[int]) -> str: """ Send action to particular nodes of validator pool. The list of requests can be send: POOL_RESTART ...
Builds a request to get a DDO. :param submitter_did: (Optional) DID of the read request sender (if not provided then default Libindy DID will be used). :param target_did: Id of Identity stored in secured Wallet. :return: Request result as json.
async def build_get_ddo_request(submitter_did: Optional[str], target_did: str) -> str: """ Builds a request to get a DDO. :param submitter_did: (Optional) DID of the read request sender (if not provided then default Libindy DID will be used). :param target_did: Id of Ide...
Builds an ATTRIB request. Request to add attribute to a NYM record. :param submitter_did: DID of the submitter stored in secured Wallet. :param target_did: Target DID as base58-encoded string for 16 or 32 bit DID value. :param xhash: (Optional) Hash of attribute data. :param raw: (Optional) Json, where...
async def build_attrib_request(submitter_did: str, target_did: str, xhash: Optional[str], raw: Optional[str], enc: Optional[str]) -> str: """ Builds an ATTRIB request. Request to add attri...
Builds a NYM request. :param submitter_did: DID of the submitter stored in secured Wallet. :param target_did: Target DID as base58-encoded string for 16 or 32 bit DID value. :param ver_key: Target identity verification key as base58-encoded string. :param alias: NYM's alias. :param role: Role of a ...
async def build_nym_request(submitter_did: str, target_did: str, ver_key: Optional[str], alias: Optional[str], role: Optional[str]) -> str: """ Builds a NYM request. :param submitter_did: DID of ...
Parse a GET_SCHEMA response to get Schema in the format compatible with Anoncreds API :param get_schema_response: response of GET_SCHEMA request. :return: Schema Id and Schema json. { id: identifier of schema attrNames: array of attribute name strings name: Schema's name string ...
async def parse_get_schema_response(get_schema_response: str) -> (str, str): """ Parse a GET_SCHEMA response to get Schema in the format compatible with Anoncreds API :param get_schema_response: response of GET_SCHEMA request. :return: Schema Id and Schema json. { id: identifier of schema...
Builds a GET_CRED_DEF request. Request to get a credential definition (in particular, public key), that Issuer creates for a particular Credential Schema. :param submitter_did: (Optional) DID of the read request sender (if not provided then default Libindy DID will be used). :param id_: Credential Definitio...
async def build_get_cred_def_request(submitter_did: Optional[str], id_: str) -> str: """ Builds a GET_CRED_DEF request. Request to get a credential definition (in particular, public key), that Issuer creates for a particular Credential Schema. :param submitter_did: (O...
Parse a GET_CRED_DEF response to get Credential Definition in the format compatible with Anoncreds API. :param get_cred_def_response: response of GET_CRED_DEF request. :return: Credential Definition Id and Credential Definition json. { id: string - identifier of credential definition ...
async def parse_get_cred_def_response(get_cred_def_response: str) -> (str, str): """ Parse a GET_CRED_DEF response to get Credential Definition in the format compatible with Anoncreds API. :param get_cred_def_response: response of GET_CRED_DEF request. :return: Credential Definition Id and Credential D...
Builds a GET_VALIDATOR_INFO request. :param submitter_did: Id of Identity stored in secured Wallet. :return: Request result as json.
async def build_get_validator_info_request(submitter_did: str) -> str: """ Builds a GET_VALIDATOR_INFO request. :param submitter_did: Id of Identity stored in secured Wallet. :return: Request result as json. """ logger = logging.getLogger(__name__) logger.debug("build_get_validator_info_req...
Builds a GET_TXN request. Request to get any transaction by its seq_no. :param submitter_did: (Optional) DID of the read request sender (if not provided then default Libindy DID will be used). :param ledger_type: (Optional) type of the ledger the requested transaction belongs to: DOMAIN - used default,...
async def build_get_txn_request(submitter_did: Optional[str], ledger_type: Optional[str], seq_no: int) -> str: """ Builds a GET_TXN request. Request to get any transaction by its seq_no. :param submitter_did: (Optional) DID of the read request...
Builds a POOL_CONFIG request. Request to change Pool's configuration. :param submitter_did: DID of the submitter stored in secured Wallet. :param writes: Whether any write requests can be processed by the pool (if false, then pool goes to read-only state). True by default. :param force: ...
async def build_pool_config_request(submitter_did: str, writes: bool, force: bool) -> str: """ Builds a POOL_CONFIG request. Request to change Pool's configuration. :param submitter_did: DID of the submitter stored in secured Wallet. ...
Builds a POOL_RESTART request :param submitter_did: Id of Identity that sender transaction :param action : Action that pool has to do after received transaction. Can be "start" or "cancel" :param datetime : Time when pool must be restarted.
async def build_pool_restart_request(submitter_did: str, action: str, datetime: str) -> str: """ Builds a POOL_RESTART request :param submitter_did: Id of Identity that sender transaction :param action : Action that pool has to do after received transaction. Can be "star...
Builds a POOL_UPGRADE request. Request to upgrade the Pool (sent by Trustee). It upgrades the specified Nodes (either all nodes in the Pool, or some specific ones). :param submitter_did: DID of the submitter stored in secured Wallet. :param name: Human-readable name for the upgrade. :param version: The...
async def build_pool_upgrade_request(submitter_did: str, name: str, version: str, action: str, _sha256: str, _timeout: Optional[int], ...
Builds a GET_REVOC_REG_DEF request. Request to get a revocation registry definition, that Issuer creates for a particular Credential Definition. :param submitter_did: (Optional) DID of the read request sender (if not provided then default Libindy DID will be used). :param rev_reg_def_id: ID of Revocation R...
async def build_get_revoc_reg_def_request(submitter_did: Optional[str], rev_reg_def_id: str) -> str: """ Builds a GET_REVOC_REG_DEF request. Request to get a revocation registry definition, that Issuer creates for a particular Credential Definition. :param subm...
Parse a GET_REVOC_REG_DEF response to get Revocation Registry Definition in the format compatible with Anoncreds API. :param get_revoc_ref_def_response: response of GET_REVOC_REG_DEF request. :return: Revocation Registry Definition Id and Revocation Registry Definition json. { "id": string - ID...
async def parse_get_revoc_reg_def_response(get_revoc_ref_def_response: str) -> (str, str): """ Parse a GET_REVOC_REG_DEF response to get Revocation Registry Definition in the format compatible with Anoncreds API. :param get_revoc_ref_def_response: response of GET_REVOC_REG_DEF request. :return: Revocat...
Builds a REVOC_REG_ENTRY request. Request to add the RevocReg entry containing the new accumulator value and issued/revoked indices. This is just a delta of indices, not the whole list. So, it can be sent each time a new credential is issued/revoked. :param submitter_did: DID of the submitter stored in se...
async def build_revoc_reg_entry_request(submitter_did: str, revoc_reg_def_id: str, rev_def_type: str, value: str) -> str: """ Builds a REVOC_REG_ENTRY request. Request to add the RevocReg ent...
Builds a GET_REVOC_REG request. Request to get the accumulated state of the Revocation Registry by ID. The state is defined by the given timestamp. :param submitter_did: (Optional) DID of the read request sender (if not provided then default Libindy DID will be used). :param revoc_reg_def_id: ID of the co...
async def build_get_revoc_reg_request(submitter_did: Optional[str], revoc_reg_def_id: str, timestamp: int) -> str: """ Builds a GET_REVOC_REG request. Request to get the accumulated state of the Revocation Registry by ID. The state ...
Parse a GET_REVOC_REG response to get Revocation Registry in the format compatible with Anoncreds API. :param get_revoc_reg_response: response of GET_REVOC_REG request. :return: Revocation Registry Definition Id, Revocation Registry json and Timestamp. { "value": Registry-specific data { ...
async def parse_get_revoc_reg_response(get_revoc_reg_response: str) -> (str, str, int): """ Parse a GET_REVOC_REG response to get Revocation Registry in the format compatible with Anoncreds API. :param get_revoc_reg_response: response of GET_REVOC_REG request. :return: Revocation Registry Definition Id...
Builds a GET_REVOC_REG_DELTA request. Request to get the delta of the accumulated state of the Revocation Registry. The Delta is defined by from and to timestamp fields. If from is not specified, then the whole state till to will be returned. :param submitter_did: (Optional) DID of the read request sender ...
async def build_get_revoc_reg_delta_request(submitter_did: Optional[str], revoc_reg_def_id: str, from_: Optional[int], to: int) -> str: """ Builds a GET_REVOC_REG_DELTA request. Re...
Parse a GET_REVOC_REG_DELTA response to get Revocation Registry Delta in the format compatible with Anoncreds API. :param get_revoc_reg_delta_response: response of GET_REVOC_REG_DELTA request. :return: Revocation Registry Definition Id, Revocation Registry Delta json and Timestamp. { "value": R...
async def parse_get_revoc_reg_delta_response(get_revoc_reg_delta_response: str) -> (str, str, int): """ Parse a GET_REVOC_REG_DELTA response to get Revocation Registry Delta in the format compatible with Anoncreds API. :param get_revoc_reg_delta_response: response of GET_REVOC_REG_DELTA request. :retur...
Parse transaction response to fetch metadata. The important use case for this method is validation of Node's response freshens. Distributed Ledgers can reply with outdated information for consequence read request after write. To reduce pool load libindy sends read requests to one random node in the pool...
async def get_response_metadata(response: str) -> str: """ Parse transaction response to fetch metadata. The important use case for this method is validation of Node's response freshens. Distributed Ledgers can reply with outdated information for consequence read request after write. To reduce ...
Builds a AUTH_RULE request. Request to change authentication rules for a ledger transaction. :param submitter_did: DID of the submitter stored in secured Wallet. :param txn_type: ledger transaction alias or associated value. :param action: type of an action. Can be either "ADD" (to add a new rule) o...
async def build_auth_rule_request(submitter_did: str, txn_type: str, action: str, field: str, old_value: Optional[str], new_value: Optional[str], ...
Creates keys (signing and encryption keys) for a new DID (owned by the caller of the library). Identity's DID must be either explicitly provided, or taken as the first 16 bit of verkey. Saves the Identity DID with keys in a secured Wallet, so that it can be used to sign and encrypt transactions. :p...
async def create_and_store_my_did(wallet_handle: int, did_json: str) -> (str, str): """ Creates keys (signing and encryption keys) for a new DID (owned by the caller of the library). Identity's DID must be either explicitly provided, or taken as the first 16 bit of verk...
Generated new keys (signing and encryption keys) for an existing DID (owned by the caller of the library). :param wallet_handle: wallet handler (created by open_wallet). :param did: signing DID :param identity_json: Identity information as json. Example: { "seed": string, (optional) Se...
async def replace_keys_start(wallet_handle: int, did: str, identity_json: str) -> str: """ Generated new keys (signing and encryption keys) for an existing DID (owned by the caller of the library). :param wallet_handle: wallet handler (created b...
Apply temporary keys as main for an existing DID (owned by the caller of the library). :param wallet_handle: wallet handler (created by open_wallet). :param did: The DID to resolve key. :return: Error code
async def replace_keys_apply(wallet_handle: int, did: str) -> None: """ Apply temporary keys as main for an existing DID (owned by the caller of the library). :param wallet_handle: wallet handler (created by open_wallet). :param did: The DID to resolve key. :return: Err...
Saves their DID for a pairwise connection in a secured Wallet, so that it can be used to verify transaction. :param wallet_handle: wallet handler (created by open_wallet). :param identity_json: Identity information as json. Example: { "did": string, (required) "verkey": string...
async def store_their_did(wallet_handle: int, identity_json: str) -> None: """ Saves their DID for a pairwise connection in a secured Wallet, so that it can be used to verify transaction. :param wallet_handle: wallet handler (created by open_wallet). :param identity_json: ...
Creates keys pair and stores in the wallet. :param wallet_handle: Wallet handle (created by open_wallet). :param key_json: Key information as json. Example: { "seed": string, (optional) Seed that allows deterministic key creation (if not set random one will be created). ...
async def create_key(wallet_handle: int, key_json: str) -> str: """ Creates keys pair and stores in the wallet. :param wallet_handle: Wallet handle (created by open_wallet). :param key_json: Key information as json. Example: { "seed": string, (optional) Seed that a...
Creates keys pair and stores in the wallet. :param wallet_handle: Wallet handle (created by open_wallet). :param verkey: the key (verkey, key id) to store metadata. :param metadata: the meta information that will be store with the key. :return: Error code
async def set_key_metadata(wallet_handle: int, verkey: str, metadata: str) -> None: """ Creates keys pair and stores in the wallet. :param wallet_handle: Wallet handle (created by open_wallet). :param verkey: the key (verkey, key id) to store metada...
Retrieves the meta information for the giving key in the wallet. :param wallet_handle: Wallet handle (created by open_wallet). :param verkey: The key (verkey, key id) to retrieve metadata. :return: metadata: The meta information stored with the key; Can be null if no metadata was saved for this key.
async def get_key_metadata(wallet_handle: int, verkey: str) -> str: """ Retrieves the meta information for the giving key in the wallet. :param wallet_handle: Wallet handle (created by open_wallet). :param verkey: The key (verkey, key id) to retrieve metadata. :return: me...
Set/replaces endpoint information for the given DID. :param wallet_handle: Wallet handle (created by open_wallet). :param did: The DID to resolve endpoint. :param address: The DIDs endpoint address. :param transport_key: The DIDs transport key (ver key, key id). :return: Error code
async def set_endpoint_for_did(wallet_handle: int, did: str, address: str, transport_key: str) -> None: """ Set/replaces endpoint information for the given DID. :param wallet_handle: Wallet handle (created by open_...
Returns endpoint information for the given DID. :param wallet_handle: Wallet handle (created by open_wallet). :param pool_handle: Pool handle (created by open_pool). :param did: The DID to resolve endpoint. :return: (endpoint, transport_vk)
async def get_endpoint_for_did(wallet_handle: int, pool_handle: int, did: str) -> (str, Optional[str]): """ Returns endpoint information for the given DID. :param wallet_handle: Wallet handle (created by open_wallet). :param pool_handle: Poo...
Saves/replaces the meta information for the giving DID in the wallet. :param wallet_handle: Wallet handle (created by open_wallet). :param did: the DID to store metadata. :param metadata: the meta information that will be store with the DID. :return: Error code
async def set_did_metadata(wallet_handle: int, did: str, metadata: str) -> None: """ Saves/replaces the meta information for the giving DID in the wallet. :param wallet_handle: Wallet handle (created by open_wallet). :param did: the DID to store met...
Get DID metadata and verkey stored in the wallet. :param wallet_handle: wallet handler (created by open_wallet). :param did: The DID to retrieve metadata. :return: DID with verkey and metadata.
async def get_my_did_with_meta(wallet_handle: int, did: str) -> str: """ Get DID metadata and verkey stored in the wallet. :param wallet_handle: wallet handler (created by open_wallet). :param did: The DID to retrieve metadata. :return: DID with verkey and metadata. """ logger = logging.ge...
Retrieves abbreviated verkey if it is possible otherwise return full verkey. :param did: The DID. :param full_verkey: The DIDs verification key, :return: metadata: Either abbreviated or full verkey.
async def abbreviate_verkey(did: str, full_verkey: str) -> str: """ Retrieves abbreviated verkey if it is possible otherwise return full verkey. :param did: The DID. :param full_verkey: The DIDs verification key, :return: metadata: Either abbreviated or full verkey. ""...
Creates a credential with an offer. :param source_id: user defined id of object. :param credential_offer: JSON string representing the offer used as the basis of creation. :return: A created credential Example: offer = [{ "msg_type": "CLAIM_OFFER", "version"...
async def create(source_id: str, credential_offer: str): """ Creates a credential with an offer. :param source_id: user defined id of object. :param credential_offer: JSON string representing the offer used as the basis of creation. :return: A created credential Example: ...
Create a credential based off of a known message id for a given connection. :param source_id: user defined id of object. :param connection: connection handle of connection to receive offer from :param msg_id: message id :return: A created credential Example: credential = ...
async def create_with_msgid(source_id: str, connection: Connection, msg_id: str): """ Create a credential based off of a known message id for a given connection. :param source_id: user defined id of object. :param connection: connection handle of connection to receive offer from ...
Create a credential object from a previously serialized credential object :param data: JSON data from a serialized object. :return: A created credential Example: credential = await Credential.create(source_id, offer) data = await credential.serialize() credential2 = await...
async def deserialize(data: dict): """ Create a credential object from a previously serialized credential object :param data: JSON data from a serialized object. :return: A created credential Example: credential = await Credential.create(source_id, offer) data = a...
Retrieves all pending credential offers for a given connection. :param connection: A connection handle :return: A list of dictionary objects representing offers from a given connection. Example: credential = await Credential.create_with_msgid(source_id, connection, msg_id) offers...
async def get_offers(connection: Connection) -> dict: """ Retrieves all pending credential offers for a given connection. :param connection: A connection handle :return: A list of dictionary objects representing offers from a given connection. Example: credential = await ...
Approves the credential offer and submits a credential request. The result will be a credential stored in the prover's wallet. :param connection: connection to submit request from :param payment_handle: currently unused :return: Example: connection = await Connection.create(sourc...
async def send_request(self, connection: Connection, payment_handle: int): """ Approves the credential offer and submits a credential request. The result will be a credential stored in the prover's wallet. :param connection: connection to submit request from :param payment_handle: curren...
Retrieve Payment Transaction Information for this Credential. Typically this will include how much payment is requried by the issuer, which needs to be provided by the prover, before the issuer will issue the credential to the prover. Ideally a prover would want to know how much payment is being asked b...
async def get_payment_info(self): """ Retrieve Payment Transaction Information for this Credential. Typically this will include how much payment is requried by the issuer, which needs to be provided by the prover, before the issuer will issue the credential to the prover. Ideally a prove...
Retirieve the payment transaction associated with this credential. This can be used to get the txn that was used to pay the issuer from the prover. This could be considered a receipt of payment from the payer to the issuer. :return: Example: txn = credential.get_payment_txn()
async def get_payment_txn(self): """ Retirieve the payment transaction associated with this credential. This can be used to get the txn that was used to pay the issuer from the prover. This could be considered a receipt of payment from the payer to the issuer. :return: E...
Create a connection object, represents a single endpoint and can be used for sending and receiving credentials and proofs :param source_id: Institution's unique ID for the connection :return: connection object Example: connection = await Connection.create(source_id)
async def create(source_id: str): """ Create a connection object, represents a single endpoint and can be used for sending and receiving credentials and proofs :param source_id: Institution's unique ID for the connection :return: connection object Example: connec...
Create a connection object with a provided invite, represents a single endpoint and can be used for sending and receiving credentials and proofs Invite details are provided by the entity offering a connection and generally pulled from a provided QRCode. :param source_id: Institution's unique ID...
async def create_with_details(source_id: str, invite_details: str): """ Create a connection object with a provided invite, represents a single endpoint and can be used for sending and receiving credentials and proofs Invite details are provided by the entity offering a connection and ge...
Create the object from a previously serialized object. :param data: The output of the "serialize" call Example: data = await connection1.serialize() connection2 = await Connection.deserialize(data) :return: A re-instantiated object
async def deserialize(data: dict): """ Create the object from a previously serialized object. :param data: The output of the "serialize" call Example: data = await connection1.serialize() connection2 = await Connection.deserialize(data) :return: A re-instantiated...
Connect securely and privately to the endpoint represented by the object. :param options: detailed connection options Example options: {"connection_type":"SMS","phone":"5555555555","use_public_did":true} or: {"connection_type":"QR"} Example code: connection = awa...
async def connect(self, options: str) -> str: """ Connect securely and privately to the endpoint represented by the object. :param options: detailed connection options Example options: {"connection_type":"SMS","phone":"5555555555","use_public_did":true} or: {"con...
Send a generic message to the connection :param msg: :param msg_type: :param msg_title: :return:
async def send_message(self, msg: str, msg_type: str, msg_title: str) -> str: """ Send a generic message to the connection :param msg: :param msg_type: :param msg_title: :return: """ if not hasattr(Connection.send_message, "cb"): ...
Sign data using connection's pairwise key :param msg: :return: signature
async def sign_data(self, msg: bytes) -> bytes: """ Sign data using connection's pairwise key :param msg: :return: signature """ def transform_cb(arr_ptr: POINTER(c_uint8), arr_len: c_uint32): return bytes(arr_ptr[:arr_len]), if not hasattr(Connectio...
Verification the signature of a msg :param msg: :param signature: :return: bool
async def verify_signature(self, msg: bytes, signature: bytes) -> bool: """ Verification the signature of a msg :param msg: :param signature: :return: bool """ if not hasattr(Connection.verify_signature, "cb"): self.logger.debug("vcx_connection_verify_...
Get the invite details that were sent or can be sent to the endpoint. :param abbreviated: abbreviate invite details or not Example: phone_number = '8019119191' connection = await Connection.create('foobar123') invite_details = await connection.connect(phone_number) inivt...
async def invite_details(self, abbreviated: bool) -> dict: """ Get the invite details that were sent or can be sent to the endpoint. :param abbreviated: abbreviate invite details or not Example: phone_number = '8019119191' connection = await Connection.create('foobar123'...
Create a proof for fulfilling a corresponding proof request :param source_id: Tag associated by user of sdk :param proof_request: Proof Request data sent by requestor. Example: source_id = 'sourceId' request = { "@topic": { "mid": 9, "tid": 1 ...
async def create(source_id: str, proof_request: str): """ Create a proof for fulfilling a corresponding proof request :param source_id: Tag associated by user of sdk :param proof_request: Proof Request data sent by requestor. Example: source_id = 'sourceId' reques...
:param data: Data provided by the serialize method Example: msg_id = '1' phone_number = '8019119191' connection = await Connection.create(source_id) await connection.connect(phone_number) disclosed_proof = await DisclosedProof.create_with_msgid(source_id, connection, msg_...
async def deserialize(data: dict): """ :param data: Data provided by the serialize method Example: msg_id = '1' phone_number = '8019119191' connection = await Connection.create(source_id) await connection.connect(phone_number) disclosed_proof = await Discl...
Example: msg_id = '1' phone_number = '8019119191' connection = await Connection.create(source_id) await connection.connect(phone_number) disclosed_proof = await DisclosedProof.create_with_msgid(source_id, connection, msg_id) requests = await DisclosedProof.get_requests(co...
async def get_requests(connection: Connection) -> dict: """ Example: msg_id = '1' phone_number = '8019119191' connection = await Connection.create(source_id) await connection.connect(phone_number) disclosed_proof = await DisclosedProof.create_with_msgid(source_id,...
Gets the credentials from a disclosed proof Example: msg_id = '1' phone_number = '8019119191' connection = await Connection.create(source_id) await connection.connect(phone_number) disclosed_proof = await DisclosedProof.create_with_msgid(source_id, connection, msg_id) ...
async def get_creds(self) -> dict: """ Gets the credentials from a disclosed proof Example: msg_id = '1' phone_number = '8019119191' connection = await Connection.create(source_id) await connection.connect(phone_number) disclosed_proof = await DisclosedPro...