Skip to main content

An API client for TRISA Envoy nodes that enables travel rule compliance.

Project description

PyEnvoy

A Python API client for TRISA Envoy nodes.

Envoy is a secure messaging tool designed for travel rule data exchanges, ensuring compliance using the TRISA (Travel Rule Information Sharing Architecture) and TRP (Travel Rule Protocol) protocols.

Virtual Asset Service Providers (VASPs) can deploy an Envoy node in order to interact with the compliance network using peer-to-peer messaging. The pyenvoy package allows VASPs to interact with their Envoy node programatically in Python so that they can:

  • Manage users and API keys
  • Manage customer accounts and counterparty information
  • Create, view, and manage travel rule transactions
  • Send and receive secure envelopes with counterparties
  • Manage public keys on the node
  • Manage the configuration of the node

The API allows users to treat Envoy as their boundary node to compliance networks, and integrate travel rule data exchanges with their transaction processing systems or internal compliance tools.

Version note

Envoy uses semantic versioning like major.minor.micro (for full release versions). API-compatibility between the Envoy server and pyenvoy client will be based on the major.minor version, however the micro version may differ between the two.

Getting Started

You will need to deploy or host an Envoy node at a URL accessible by the client, then generate an API key and save the client ID and secret for the keys.

You can install PyEnvoy as follows:

pip install -U pyenvoy

Set the following environment variables:

  1. $ENVOY_URL: the url of your Envoy API, e.g. "https://myenvoy.tr-envoy.com/"
  2. $ENVOY_CLIENT_ID: the client ID of your API keys
  3. $ENVOY_CLIENT_SECRET: the client secret for your API keys

If you're using the connect() function, you can also store these variables in a .env file in your current working directory (see .env.template).

Create an envoy client:

from envoy import connect

envoy = connect()

This will create the client and load the environment variables. You can test your connection to the server:

>>> envoy.status()
{'status': 'ok', 'uptime': '71h33m42.068692289s', 'version': '0.24.0-beta.28 (019fd7e)'}

Which should return the status, uptime, and version of your envoy node. Note that the status endpoint does not require authentication, so this will not check if your credentials are correct.

REST Usage

The Envoy API is implemented as a RESTful architecture. To that end, each resource in the API can generally be accessed with list, create, detail, update, and delete methods and may have other associated actions such as send for transactions. For example, to get a list of counterparties from the server you would use:

envoy.counterparties.list()

Or to create a customer account you would:

account_data = {...}
envoy.accounts.create(account_data)

All resources are named on the envoy.Client and are accessed as properties of the client; each of their methods can then be used to interact with the resource.

For advanced usage, note that the client also has get, post, put, and delete methods, in which you can directly make requests to the Envoy node.

Error Handling

Envoy specific errors will be a subclass of EnvoyError. An ServerError is raised when the Envoy node returns a 500 status code, and a ClientError is raised when the node returns a 400 status code. AuthenticationError is returned when no api key credentials are specified or the Server returns a 401 or 403 status code.

Note that all API keys have a set of permissions that defines what actions they can take, if your API keys do not have the required permissions for an action, an AuthenticationError will be raised.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyenvoy-1.3.1.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyenvoy-1.3.1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file pyenvoy-1.3.1.tar.gz.

File metadata

  • Download URL: pyenvoy-1.3.1.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyenvoy-1.3.1.tar.gz
Algorithm Hash digest
SHA256 d8e4a8459dac9ff0a785ac282554c7197e6d254d30c61f29d6ef22e3b94c4816
MD5 fca7289e61f9c58837caf5c35a2a1f2a
BLAKE2b-256 fdf146f82f670b8e53405400168b14d042eabb6b4ac906055fe85e71978cb82e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyenvoy-1.3.1.tar.gz:

Publisher: publish.yaml on trisacrypto/pyenvoy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyenvoy-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: pyenvoy-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyenvoy-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3a57260e8c000c4389015942eb719ddb7ea78eff5a0d50c1b051ad3eee456ea
MD5 e0c0157065c97a47975947e8c9f0cfad
BLAKE2b-256 c4eb28f84742a68e16306872b8b954cf5195e8669230a44616bcc041e933794a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyenvoy-1.3.1-py3-none-any.whl:

Publisher: publish.yaml on trisacrypto/pyenvoy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page