friendtech


Namefriendtech JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryA python module for friend.tech
upload_time2023-08-24 19:43:25
maintainer
docs_urlNone
authorItsAditya (https://itsaditya.xyz)
requires_python
license
keywords friend.tech social media crypto decentralized social media
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# 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](https://twitter.com/itsaditya_xyz)



For support join discord: [FriendTechFeed](https://discord.gg/sVNcFK73YW)



## How to Use:



# Platform Info



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



```python

import friendtech



platform = friendtech.Platform()

globalActivity = platform.getGlobalActivity().json()

print(globalActivity)

```



2. Getting recently joined users



```python

import friendtech



platform = friendtech.Platform()

recentlyJoined = platform.getRecentlyJoinedUsers().json()

print(recentlyJoined)

```



3. Getting address from twitter username



```python

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)

```



4. Getting share and profile info from address



```python

import friendtech



platform = friendtech.Platform()

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

print(userInfo)

```



5. Getting holders of an address



```python

import friendtech



platform = friendtech.Platform()

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

print(holderInfo)

```



6. Getting holdings of an address



```python

import friendtech



platform = friendtech.Platform()

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

print(holdingInfo)

```



7. Getting info from userID

```python

import friendtech

platform = friendtech.Platform()

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

print(userInfo)

```





# Contract



1. Getting buy price of a share



```python

import friendtech



contract = friendtech.Contract()

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

print(buyPrice)

```



2. Getting buy price after fee of a share



```python

import friendtech



contract = friendtech.Contract()

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

print(buyPrice)

```



3. Getting sell price of a share



```python

import friendtech



contract = friendtech.Contract()

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

print(sellPrice)

```



4. Getting sell price after fee of a share



```python

import friendtech



contract = friendtech.Contract()

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

print(sellPrice)

```



5. Getting shares supply



```python

import friendtech



contract = friendtech.Contract()

shareSupply = contract.getSharesSupply("0xeab1e59d08e927ec19c9249f4841395bc4af43b8")

print(shareSupply)

```



6. Getting shares owned by an address for subjectAddress



```python

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



```python

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)

```




            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "friendtech",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "friend.tech,social media,crypto,decentralized social media",
    "author": "ItsAditya (https://itsaditya.xyz)",
    "author_email": "<chaudharyaditya0005@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ae/2d/68ec78f07f9581a27cbfebeae155c2986eb0e06221bba7e3cd7224fd897a/friendtech-0.1.1.tar.gz",
    "platform": null,
    "description": "\r\n# friendtech - A python module to interact with friend.tech platform\r\r\n\r\r\nRun `pip install friendtech` to install the module!\r\r\n\r\r\nThe module uses friend.tech APIs (by default) and you can change the nodeURL to use any other node.\r\r\n\r\r\nDeveloped by [ItsAditya](https://twitter.com/itsaditya_xyz)\r\r\n\r\r\nFor support join discord: [FriendTechFeed](https://discord.gg/sVNcFK73YW)\r\r\n\r\r\n## How to Use:\r\r\n\r\r\n# Platform Info\r\r\n\r\r\n1. Getting global activity (list of recent trades on the platform)\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\nplatform = friendtech.Platform()\r\r\nglobalActivity = platform.getGlobalActivity().json()\r\r\nprint(globalActivity)\r\r\n```\r\r\n\r\r\n2. Getting recently joined users\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\nplatform = friendtech.Platform()\r\r\nrecentlyJoined = platform.getRecentlyJoinedUsers().json()\r\r\nprint(recentlyJoined)\r\r\n```\r\r\n\r\r\n3. Getting address from twitter username\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\njwt = <YOUR JWT TOKEN> # get this from local storage of friendtech in your browser\r\r\nplatform = friendtech.Platform(jwt=jwt)\r\r\naddressInfo = platform.getAddressFromTwitterUsername(\"itsaditya_xyz\").json()\r\r\nprint(addressInfo)\r\r\n```\r\r\n\r\r\n4. Getting share and profile info from address\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\nplatform = friendtech.Platform()\r\r\nuserInfo = platform.getInfoFromAddress(\"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\").json()\r\r\nprint(userInfo)\r\r\n```\r\r\n\r\r\n5. Getting holders of an address\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\nplatform = friendtech.Platform()\r\r\nholderInfo = platform.getHolders(\"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\").json()\r\r\nprint(holderInfo)\r\r\n```\r\r\n\r\r\n6. Getting holdings of an address\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\nplatform = friendtech.Platform()\r\r\nholdingInfo = platform.getHoldings(\"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\").json()\r\r\nprint(holdingInfo)\r\r\n```\r\r\n\r\r\n7. Getting info from userID\r\r\n```python\r\r\nimport friendtech\r\r\nplatform = friendtech.Platform()\r\r\nuserInfo = platform.getInfoFromUserID(69).json()\r\r\nprint(userInfo)\r\r\n```\r\r\n\r\r\n\r\r\n# Contract\r\r\n\r\r\n1. Getting buy price of a share\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\ncontract = friendtech.Contract()\r\r\nbuyPrice = contract.getBuyPrice(\"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\", 1)\r\r\nprint(buyPrice)\r\r\n```\r\r\n\r\r\n2. Getting buy price after fee of a share\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\ncontract = friendtech.Contract()\r\r\nbuyPrice = contract.getBuyPriceAfterFee(\"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\", 1)\r\r\nprint(buyPrice)\r\r\n```\r\r\n\r\r\n3. Getting sell price of a share\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\ncontract = friendtech.Contract()\r\r\nsellPrice = contract.getSellPrice(\"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\", 1)\r\r\nprint(sellPrice)\r\r\n```\r\r\n\r\r\n4. Getting sell price after fee of a share\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\ncontract = friendtech.Contract()\r\r\nsellPrice = contract.getSellPriceAfterFee(\"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\", 1)\r\r\nprint(sellPrice)\r\r\n```\r\r\n\r\r\n5. Getting shares supply\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\ncontract = friendtech.Contract()\r\r\nshareSupply = contract.getSharesSupply(\"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\")\r\r\nprint(shareSupply)\r\r\n```\r\r\n\r\r\n6. Getting shares owned by an address for subjectAddress\r\r\n\r\r\n```python\r\r\nimport friendtech\r\r\n\r\r\ncontract = friendtech.Contract()\r\r\naddress = \"0xeab1e59d08e927ec19c9249f4841395bc4af43b8\"\r\r\nsubjectAddress = \"0x61da0a10f748a4d0c7060cd0d9907f9174f59a15\"\r\r\nsharesOwned = contract.getSharesSupply(address, subjectAddress)\r\r\nprint(sharesOwned)\r\r\n```\r\r\n\r\r\n\r\r\n# WRITING FUNCTIONS OF CONTRACT\r\r\n\r\r\nTo execute writing functions you will need a wallet that has some eth on base network\r\r\n\r\r\n1. Create a new wallet (store the private key in .env always!)\r\r\n\r\r\n```python\r\r\nfrom eth_account import Account\r\r\nimport secrets\r\r\npriv = secrets.token_hex(32)\r\r\nprivate_key = \"0x\" + priv\r\r\nprint (\"SAVE BUT DO NOT SHARE THIS:\", private_key)\r\r\nacct = Account.from_key(private_key)\r\r\nprint(\"Address:\", acct.address)\r\r\n```\r\r\n\r\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A python module for friend.tech",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "friend.tech",
        "social media",
        "crypto",
        "decentralized social media"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae2d68ec78f07f9581a27cbfebeae155c2986eb0e06221bba7e3cd7224fd897a",
                "md5": "e4bdf0fd6db5f81ba98c269a47398fd7",
                "sha256": "7d10f79bb0fb5615c970e162b84c002de2dc3ff435438c17d050ebd6e6367c99"
            },
            "downloads": -1,
            "filename": "friendtech-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e4bdf0fd6db5f81ba98c269a47398fd7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4510,
            "upload_time": "2023-08-24T19:43:25",
            "upload_time_iso_8601": "2023-08-24T19:43:25.097337Z",
            "url": "https://files.pythonhosted.org/packages/ae/2d/68ec78f07f9581a27cbfebeae155c2986eb0e06221bba7e3cd7224fd897a/friendtech-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-24 19:43:25",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "friendtech"
}
        
Elapsed time: 0.10453s