Skip to main content

vFunctions SDK

This package offers tools to develop vFunctions inside a secure enclave.

For an use case example visit the Verifiably documentation page.

Installation

To install this library run:

pip install vfunctions_sdk

Mercury Bank example

import json

from vfunctions_sdk import vFunction
from vfunctions_sdk import connection

def mercury_balance_check(account_id, mercury_token, params):

    # Set the url for the mercury API to get the account information
    # Use the account id
    mercury_bank_url = "https://api.mercury.com/api/v1/account/{}".format(account_id)

    # Use the mercury token for the API
    headers = {
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": "Bearer {}".format(mercury_token)
    }

    response = requests.request("GET", mercury_bank_url, headers=headers)
    mercury_data = json.loads(response.text)

    if "errors" in mercury_data:
        return False

    if mercury_data["currentBalance"] > params["balance_threshold"]:
        return True

    return False


def main():

    function_params = vFunction.FunctionParams()

    # Get the secrets from the provider
    secrets_bundle = connection.WsockSecretsProvider(function_params).get_secrets()

    # Get the necessary secrets
    account_id = secrets_bundle["mercuryBank"]["accountId"]
    mercury_token = secrets_bundle["mercuryBank"]["mercuryToken"]

    # Get the information from the mercury account
    result_value = mercury_balance_check(account_id, mercury_token, function_params.params)

    result_dict = {
            "result": result_value,
            "balance": function_params.params["balance_threshold"]
    }

    # Send the email with the results
    function_params.email_results(function_params.params['email'], result_dict)

if __name__ == '__main__':
    main()

Metadata

Release files for vfunctions-sdk 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vfunctions-sdk 0.0.7
File Size Uploaded Provenance Actions
vfunctions_sdk-0.0.7.tar.gz 5.5 kB Without provenance Details for vfunctions_sdk-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vfunctions-sdk 0.0.7
File Interpreter ABI Platform Actions
vfunctions_sdk-0.0.7-py3-none-any.whl Python 3 none any Details for vfunctions_sdk-0.0.7-py3-none-any.whl

Total release size: 15.9 kB

Release files / vfunctions_sdk-0.0.7.tar.gz

Download URL vfunctions_sdk-0.0.7.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7096d493d7eba1084240f1bc5b237bdc4320f15ece5c43cab4360f236fa81585
BLAKE2b-256 checksum
How to use checksums
0041b8e773a6835a994dc8dad83e7f9182101ddbf4488bf91e2a30177cff7cb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.2 tqdm/4.63.0 importlib-metadata/4.10.1 keyring/22.2.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

Release files / vfunctions_sdk-0.0.7-py3-none-any.whl

Download URL vfunctions_sdk-0.0.7-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82f05afc670a88c695317c184e4ad3740de9cc3977f657d57eaf1548e3bafe40
BLAKE2b-256 checksum
How to use checksums
44798a51c8467b6b03d4e1457a18bf892c0db124803d9881205ba4c44dd77016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.2 tqdm/4.63.0 importlib-metadata/4.10.1 keyring/22.2.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

Security for vfunctions-sdk 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page