Skip to content

aleph-im/superfluid.py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Superfluid Python SDK(Unofficial) 👋

📖 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)

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%