Skip to main content

Fork of the Python SDK for the Superfluid Protocol

Project description

Welcome to Superfluid Python SDK(Unofficial) 👋

🏠 Homepage

Superfluid App

📖 Docs


Introduction

superfluid.py is an application framework for interacting with the Superfluid Protocol using the Python Programming Language.

This is a friendly fork that adds support for the Base blockchain. It may be deprecated once merged upstream.

Features

  • Minimal Framework initialization (rpc and chain id)
  • New Operation syntax for transactions
  • Read/Create/Update/Delete Agreement Operations (Constant Flow Agreement and Instant Distribution Agreement(In development))

Notable Used Technologies

  • Python
  • Web3.py

Installation

pip install superfluid

Usage

from superfluid import CFA_V1
from superfluid import Web3FlowInfo

rpc: str = "YOUR PREFERRED RPC"
chain_id: int = "CHAIN ID"

######################################################
###### CONSTANT FLOW AGREEMENT OPERATIONS ###########
######################################################

cfaV1Instance = CFA_V1(rpc, chain_id)

super_token: str = "SUPER TOKEN ADDRESS"
sender: str = "SENDER ADDRESS"
receiver: str = "RECEIVER ADDRESS"
flow_rate: int = "FLOW RATE"

PRIVATE_KEY: str = "YOUR PRIVATE KEY"

flow_data: Web3FlowInfo = cfaV1Instance.get_flow(super_token, sender, receiver)

create_flow_operation = cfaV1Instance.create_flow(
    sender, receiver, super_token, flow_rate)
transaction_hash = create_flow_operation.exec(PRIVATE_KEY)

update_flow_operation = cfaV1Instance.update_flow(
    sender, receiver, super_token, flow_rate)
transaction_hash = update_flow_operation.exec(PRIVATE_KEY)

delete_flow_operation = cfaV1Instance.delete_flow(
    sender, receiver, super_token)
transaction_hash = delete_flow_operation.exec(PRIVATE_KEY)

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

aleph_superfluid-0.3.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

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

aleph_superfluid-0.3-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file aleph_superfluid-0.3.tar.gz.

File metadata

  • Download URL: aleph_superfluid-0.3.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for aleph_superfluid-0.3.tar.gz
Algorithm Hash digest
SHA256 8a7d95bf6c614bb6abdc279ccb76b650e8d13a63d51de48a8ce78f270799dbad
MD5 4d2af764bc2e468f23a40de03996249a
BLAKE2b-256 e2437c68f2c5e163008c704706ac8245c081c847f0ea8a7f4c0eae8502182ab0

See more details on using hashes here.

File details

Details for the file aleph_superfluid-0.3-py3-none-any.whl.

File metadata

  • Download URL: aleph_superfluid-0.3-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for aleph_superfluid-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4097818ac5fd99de16e3c9f77d6a91ac5c6e31e7f3a21b4dbf4f63a793ac35eb
MD5 439a006381c0f326e8479e770facbb07
BLAKE2b-256 4c9144d1f7c87c41f85e276c036c70715c63e2c05e168241f3014339e79117ff

See more details on using hashes here.

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