Skip to main content

Python library to create and submit Ethereum transactions to custodians connected with MetaMask Institutional; the most trusted DeFi wallet and Web3 gateway for organizations.

Project description

MMI Custodian SDK (Beta)

Python library to create and submit Ethereum transactions to custodians connected with MetaMask Institutional; the most trusted DeFi wallet and Web3 gateway for organizations.

BETA DISCLAIMER. THIS BETA SOFTWARE PROGRAM PRODUCT IS STILL IN ITS TESTING PHASE AND IS PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS.

Banner

Contents

Usage

Use this SDK to programmatically create Ethereum transactions, and submit them to custodians connected with MetaMask Institutional. Automate trading strategies on your wallets under custody, and still benefit from the institutional-grade security of your favorite qualified custodian and custody provider.

Getting started

pip3 install mmisdk
from mmisdk import CustodianFactory

factory = CustodianFactory()

custodian = factory.create_for("qredo", "YOUR-REFRESH-TOKEN")

transaction = custodian.create_transaction(qredo_tx_details, tx_params)
custodian.get_transaction(transaction.id)

For a complete documentation on how to use the library, visit the page MetaMask Institutional SDK, or check the GitLab repository. You can also explore various usage examples in the directory ./examples.

Supported custodians

Custodian Supported As of version Factory name param
Qredo 0.2.0 "qredo"
Qredo Dev 0.1.0 "qredo-dev"
Cactus 0.2.0 "cactus"
Cactus Dev 0.2.0 "cactus-dev"
All others

Developer documentation

The commands we list below use python and pip. Depending on your local setup, you might need to replace them by python3 and pip3.

Requirements

  • Python 3.7 or above

Installing dependencies

To install mmisdk, along with the tools you need to develop and run tests, run the following:

pip install -e .[dev]

Unit tests

Run all unit tests with:

pytest src

End to end tests

A good way to test the library is also to run the various examples scripts. First, in all examples files, replace the placeholders YOUR-REFRESH-TOKEN-XXX by real values. Then run:

cd example
pytest

Releasing automatically

To release a new version, follow these steps:

  1. Make sur you're on branch main

  2. This template provides a basic bumpversion configuration. To bump the version, run:

    • bumpversion patch to increase version from 1.0.0 to 1.0.1.
    • bumpversion minor to increase version from 1.0.0 to 1.1.0.
    • bumpversion major to increase version from 1.0.0 to 2.0.0.

    Use Semantic Versioning 2.0.0 standard to bump versions.

  3. Push the changes and the tags:

    git push --tags
    

Releasing manually

Building

Before building dists make sure you got a clean build area:

rm -rf build
rm -rf src/*.egg-info

Note:

Dirty build or egg-info dirs can cause problems: missing or stale files in the resulting dist or strange and confusing errors. Avoid having them around.

Then you should check that you got no packaging issues:

tox -e check

When checking with tox -e check, you might receive warnings from isort that imports are not properly ordered. To automatically sort your imports with isort, run the following:

pip install isort
isort .

To run a complete QA analysis, including unit tests again multiple Python versions, manifest check, and imports order check, run:

tox

And then you can build the sdist, and if possible, the bdist_wheel too:

python setup.py clean --all sdist bdist_wheel

Publishing to PyPI

To make a release of the project on PyPI, assuming you got some distributions in dist/, the most simple usage is:

twine upload --skip-existing dist/*.whl dist/*.gz dist/*.zip

In ZSH you can use this to upload everything in dist/ that ain't a linux-specific wheel (you may need setopt extended_glob):

twine upload --skip-existing dist/*.(whl|gz|zip)~dist/*linux*.whl

Contributing

See CONTRIBUTING.rst.

Changelog

See CHANGELOG.md.

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

mmisdk-0.2.1.tar.gz (216.6 kB view details)

Uploaded Source

Built Distribution

mmisdk-0.2.1-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file mmisdk-0.2.1.tar.gz.

File metadata

  • Download URL: mmisdk-0.2.1.tar.gz
  • Upload date:
  • Size: 216.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mmisdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cc8dc102569a97021c3877a3f5a197a5b8edbf449a3b89e46cda3bce9211705c
MD5 82d0df20b4fde28ec26e2b65ba854bee
BLAKE2b-256 edf52c0075344933c3413a0dda97cd87373a41c7d073cd9871b67d89dd46a25e

See more details on using hashes here.

File details

Details for the file mmisdk-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mmisdk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 29.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mmisdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01d922806c5c8f3cd0251a7545cd6f8476d35c1ec18d8f9ae81d567a765fb24e
MD5 06a7f1b09a7569fbe08d26c6da508213
BLAKE2b-256 cee421357e22c3d31b891a8f48a2637e8e3f48943417ca37a284a4c8f1459df6

See more details on using hashes here.

Supported by

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