Skip to main content

friendtech - A python module to interact with friend.tech platform

Run pip install friendtech to install the module!

The module uses friend.tech APIs (by default) and you can change the nodeURL to use any other node.

Developed by ItsAditya

For support join discord: FriendTechFeed

How to Use:

Platform Info

  1. Getting global activity (list of recent trades on the platform)
import friendtech



platform = friendtech.Platform()

globalActivity = platform.getGlobalActivity().json()

print(globalActivity)
  1. Getting recently joined users
import friendtech



platform = friendtech.Platform()

recentlyJoined = platform.getRecentlyJoinedUsers().json()

print(recentlyJoined)
  1. Getting address from twitter username
import friendtech



jwt = <YOUR JWT TOKEN> # get this from local storage of friendtech in your browser

platform = friendtech.Platform(jwt=jwt)

addressInfo = platform.getAddressFromTwitterUsername("itsaditya_xyz").json()

print(addressInfo)
  1. Getting share and profile info from address
import friendtech



platform = friendtech.Platform()

userInfo = platform.getInfoFromAddress("0xeab1e59d08e927ec19c9249f4841395bc4af43b8").json()

print(userInfo)
  1. Getting holders of an address
import friendtech



platform = friendtech.Platform()

holderInfo = platform.getHolders("0xeab1e59d08e927ec19c9249f4841395bc4af43b8").json()

print(holderInfo)
  1. Getting holdings of an address
import friendtech



platform = friendtech.Platform()

holdingInfo = platform.getHoldings("0xeab1e59d08e927ec19c9249f4841395bc4af43b8").json()

print(holdingInfo)
  1. Getting info from userID
import friendtech

platform = friendtech.Platform()

userInfo = platform.getInfoFromUserID(69).json()

print(userInfo)

Contract

  1. Getting buy price of a share
import friendtech



contract = friendtech.Contract()

buyPrice = contract.getBuyPrice("0xeab1e59d08e927ec19c9249f4841395bc4af43b8", 1)

print(buyPrice)
  1. Getting buy price after fee of a share
import friendtech



contract = friendtech.Contract()

buyPrice = contract.getBuyPriceAfterFee("0xeab1e59d08e927ec19c9249f4841395bc4af43b8", 1)

print(buyPrice)
  1. Getting sell price of a share
import friendtech



contract = friendtech.Contract()

sellPrice = contract.getSellPrice("0xeab1e59d08e927ec19c9249f4841395bc4af43b8", 1)

print(sellPrice)
  1. Getting sell price after fee of a share
import friendtech



contract = friendtech.Contract()

sellPrice = contract.getSellPriceAfterFee("0xeab1e59d08e927ec19c9249f4841395bc4af43b8", 1)

print(sellPrice)
  1. Getting shares supply
import friendtech



contract = friendtech.Contract()

shareSupply = contract.getSharesSupply("0xeab1e59d08e927ec19c9249f4841395bc4af43b8")

print(shareSupply)
  1. Getting shares owned by an address for subjectAddress
import friendtech



contract = friendtech.Contract()

address = "0xeab1e59d08e927ec19c9249f4841395bc4af43b8"

subjectAddress = "0x61da0a10f748a4d0c7060cd0d9907f9174f59a15"

sharesOwned = contract.getSharesSupply(address, subjectAddress)

print(sharesOwned)

WRITING FUNCTIONS OF CONTRACT

To execute writing functions you will need a wallet that has some eth on base network

  1. Create a new wallet (store the private key in .env always!)
from eth_account import Account

import secrets

priv = secrets.token_hex(32)

private_key = "0x" + priv

print ("SAVE BUT DO NOT SHARE THIS:", private_key)

acct = Account.from_key(private_key)

print("Address:", acct.address)

Metadata

Release files for friendtech 0.1.1

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

Source distribution (sdist)

Source distribution for friendtech 0.1.1
File Size Uploaded Provenance Actions
friendtech-0.1.1.tar.gz 4.5 kB Without provenance Details for friendtech-0.1.1.tar.gz

Release files / friendtech-0.1.1.tar.gz

Download URL friendtech-0.1.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7d10f79bb0fb5615c970e162b84c002de2dc3ff435438c17d050ebd6e6367c99
BLAKE2b-256 checksum
How to use checksums
ae2d68ec78f07f9581a27cbfebeae155c2986eb0e06221bba7e3cd7224fd897a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Security for friendtech 0.1.1

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