red-py-sdk


Namered-py-sdk JSON
Version 0.1.10 PyPI version JSON
download
home_pagehttps://github.com/reddio-com/red-py-sdk
Summaryhttps://github.com/reddio-com/red-py-sdk
upload_time2022-12-02 06:12:58
maintainer
docs_urlNone
authorReddio
requires_python
license
keywords reddio sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # red-py-sdk

![](https://img.shields.io/pypi/pyversions/Django.svg)


### install

```
pip3 install red-py-sdk
```

### Usage

#### Import

```
from redpysdk import Reddio
```

#### Init object
Init the object, you can use 'testnet' or 'mainnet' to init the sdk
```
reddio = Reddio("testnet")
```

#### Get StarkKey Pair
##### Usage
```
get_stark_key_pair()
```
It will generate an random starkkey pair

##### Example
```
>>> reddio.get_stark_key_pair()
('0x395d1708ab0ee91efcb7f26a2f4fcbe20faf3c7390517667fed37b0e481882a', '0x5aa1b67a486b6564a2b6ae7426950c03dfe6991f9d34ea45b6b0be0672a1818')
```

#### Mint NFT
##### Usage
```
mintNFT(api_key, contract_address, stark_key, amount)
```
It will mint $amount tokens of $contract_address to $stark_key. first you need to register at dashboard(dashboard.reddio.com) to get your $api_key, and make sure you register the contract_address as ERC721M

##### Example
```
>>> reddio.mintNFT(your_api_key,"0xd60523fd920eb9b7eff3e115203e32d91de5cf59","0x1ccc27877014bc1a81919fc855ebbd1b874603283c9ea93397d970b0704e581","10")
[302808, 302809, 302810, 302811, 302812, 302813, 302814, 302815, 302816, 302817]
```


#### Get Balance

##### Usage

```
get_balances(stark_key, page=1, limit=10)
```
It will return the starkkey's balance. including ERC20/ETH/ERC721

##### Example

```
reddio.get_balances("0x6ecaebbe5b9486472d964217e5470380782823bb0d865240ba916d01636310a")
```




#### Transfer

##### Usage
```
transferNFT(stark_private_key, starkkey, receiver, token_type, contract, tokenID, expiration_timestamp=4194303)
```

parameters
- stark_private_key: The private key of layer2
- starkkey: The stark key of layer2
- receiver: The receiver, should be starkkey of other account
- token_type: ERC721 or ERC721M. if mint on layer2 then it should be ERC721M. else it should be ERC721
- tokenID: The token id
- expiration_timestamp: When will it expiration, it is unix timestamp/3600

##### Example

```
reddio.transferNFT('private_key', '0x6ecaebbe5b9486472d964217e5470380782823bb0d865240ba916d01636310a', '0x1ada455b26b246260b7fd876429289639d7a0ce5fe295ff2355bd4f4da55e2', 'ERC721', '0x941661Bd1134DC7cc3D107BF006B8631F6E65Ad5', '618'))
```

In the example, you should replace the 'private_key' to the private key of the starkkey




#### Withdrawal

##### Usage
```
withdrawNFT(stark_private_key, starkkey, receiver, token_type, contract, tokenID, expiration_timestamp=4194303)
```

parameters
- stark_private_key: the private key of layer2
- starkkey: the stark key of layer2
- receiver: the receiver, should be starkkey of other account
- token_type: ERC721 or ERC721M. if mint on layer2 then it should be ERC721M. else it should be ERC721
- tokenID: the token id
- expiration_timestamp: when will it expiration, it is unix timestamp/3600

##### Example

```
reddio.withdrawNFT('private_key', '0x6ecaebbe5b9486472d964217e5470380782823bb0d865240ba916d01636310a', '0xffc882996cFAB2C8B9983394E09bb025a98e52bc', 'ERC721', '0x941661Bd1134DC7cc3D107BF006B8631F6E65Ad5', '663')
```

In the example, you should replace the 'private_key' to the private key of the starkkey


#### Others
- buy_nft
- sell_nft








            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/reddio-com/red-py-sdk",
    "name": "red-py-sdk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "reddio sdk",
    "author": "Reddio",
    "author_email": "contact@reddio.com",
    "download_url": "https://files.pythonhosted.org/packages/90/b8/ba811ed29af13ee760448d6f35aba8063c6762d7edd83c78a52096ae6055/red-py-sdk-0.1.10.tar.gz",
    "platform": null,
    "description": "# red-py-sdk\n\n![](https://img.shields.io/pypi/pyversions/Django.svg)\n\n\n### install\n\n```\npip3 install red-py-sdk\n```\n\n### Usage\n\n#### Import\n\n```\nfrom redpysdk import Reddio\n```\n\n#### Init object\nInit the object, you can use 'testnet' or 'mainnet' to init the sdk\n```\nreddio = Reddio(\"testnet\")\n```\n\n#### Get StarkKey Pair\n##### Usage\n```\nget_stark_key_pair()\n```\nIt will generate an random starkkey pair\n\n##### Example\n```\n>>> reddio.get_stark_key_pair()\n('0x395d1708ab0ee91efcb7f26a2f4fcbe20faf3c7390517667fed37b0e481882a', '0x5aa1b67a486b6564a2b6ae7426950c03dfe6991f9d34ea45b6b0be0672a1818')\n```\n\n#### Mint NFT\n##### Usage\n```\nmintNFT(api_key, contract_address, stark_key, amount)\n```\nIt will mint $amount tokens of $contract_address to $stark_key. first you need to register at dashboard(dashboard.reddio.com) to get your $api_key, and make sure you register the contract_address as ERC721M\n\n##### Example\n```\n>>> reddio.mintNFT(your_api_key,\"0xd60523fd920eb9b7eff3e115203e32d91de5cf59\",\"0x1ccc27877014bc1a81919fc855ebbd1b874603283c9ea93397d970b0704e581\",\"10\")\n[302808, 302809, 302810, 302811, 302812, 302813, 302814, 302815, 302816, 302817]\n```\n\n\n#### Get Balance\n\n##### Usage\n\n```\nget_balances(stark_key, page=1, limit=10)\n```\nIt will return the starkkey's balance. including ERC20/ETH/ERC721\n\n##### Example\n\n```\nreddio.get_balances(\"0x6ecaebbe5b9486472d964217e5470380782823bb0d865240ba916d01636310a\")\n```\n\n\n\n\n#### Transfer\n\n##### Usage\n```\ntransferNFT(stark_private_key, starkkey, receiver, token_type, contract, tokenID, expiration_timestamp=4194303)\n```\n\nparameters\n- stark_private_key: The private key of layer2\n- starkkey: The stark key of layer2\n- receiver: The receiver, should be starkkey of other account\n- token_type: ERC721 or ERC721M. if mint on layer2 then it should be ERC721M. else it should be ERC721\n- tokenID: The token id\n- expiration_timestamp: When will it expiration, it is unix timestamp/3600\n\n##### Example\n\n```\nreddio.transferNFT('private_key', '0x6ecaebbe5b9486472d964217e5470380782823bb0d865240ba916d01636310a', '0x1ada455b26b246260b7fd876429289639d7a0ce5fe295ff2355bd4f4da55e2', 'ERC721', '0x941661Bd1134DC7cc3D107BF006B8631F6E65Ad5', '618'))\n```\n\nIn the example, you should replace the 'private_key' to the private key of the starkkey\n\n\n\n\n#### Withdrawal\n\n##### Usage\n```\nwithdrawNFT(stark_private_key, starkkey, receiver, token_type, contract, tokenID, expiration_timestamp=4194303)\n```\n\nparameters\n- stark_private_key: the private key of layer2\n- starkkey: the stark key of layer2\n- receiver: the receiver, should be starkkey of other account\n- token_type: ERC721 or ERC721M. if mint on layer2 then it should be ERC721M. else it should be ERC721\n- tokenID: the token id\n- expiration_timestamp: when will it expiration, it is unix timestamp/3600\n\n##### Example\n\n```\nreddio.withdrawNFT('private_key', '0x6ecaebbe5b9486472d964217e5470380782823bb0d865240ba916d01636310a', '0xffc882996cFAB2C8B9983394E09bb025a98e52bc', 'ERC721', '0x941661Bd1134DC7cc3D107BF006B8631F6E65Ad5', '663')\n```\n\nIn the example, you should replace the 'private_key' to the private key of the starkkey\n\n\n#### Others\n- buy_nft\n- sell_nft\n\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "https://github.com/reddio-com/red-py-sdk",
    "version": "0.1.10",
    "split_keywords": [
        "reddio",
        "sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "9461e5641ddc17d7dd792948dceb3e61",
                "sha256": "6b4148d137ea78d48f3ded3c641d4e4a379144b822bb1a1eb81fa1d1b1f174f3"
            },
            "downloads": -1,
            "filename": "red_py_sdk-0.1.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9461e5641ddc17d7dd792948dceb3e61",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 58940,
            "upload_time": "2022-12-02T06:12:55",
            "upload_time_iso_8601": "2022-12-02T06:12:55.719646Z",
            "url": "https://files.pythonhosted.org/packages/6a/11/3fe6ad7672826e0ba40fd5c737eeb6ac1ee16f60175d27167be9e375a7ad/red_py_sdk-0.1.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "5a9cabcc696edffc79bd6e8695089d33",
                "sha256": "0ef68051fbff1598ed8beed2eebac4daf22a9b1718ebc079959d9cd09fbd6c37"
            },
            "downloads": -1,
            "filename": "red-py-sdk-0.1.10.tar.gz",
            "has_sig": false,
            "md5_digest": "5a9cabcc696edffc79bd6e8695089d33",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 59123,
            "upload_time": "2022-12-02T06:12:58",
            "upload_time_iso_8601": "2022-12-02T06:12:58.466260Z",
            "url": "https://files.pythonhosted.org/packages/90/b8/ba811ed29af13ee760448d6f35aba8063c6762d7edd83c78a52096ae6055/red-py-sdk-0.1.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-02 06:12:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "reddio-com",
    "github_project": "red-py-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "red-py-sdk"
}
        
Elapsed time: 0.05947s