Skip to main content

Python client for Original.

Project description

Official Python sdk for Original API

Table of Contents

📝 About Original

You can request access for an Original account at our Request Access page.

✨ Getting started

Install Original

$ pip install original-sdk

📚 Documentation

Initialization

The Original SDK is set up to expose the Original API.

Read the full Original API documentation.

from original_sdk import OriginalClient

Create a new instance of the Original client by passing in your api key and api key secret.

client = OriginalClient(api_key='YOUR_API_KEY', api_secret='API_KEY_SECRET')

User

The user methods exposed by the sdk are used to create and retrieve users from the Original API.

# create a new user
new_user_uid = client.create_user(email='YOUR_EMAIL', client_id='YOUR_CLIENT_ID' )

# gets a user by uid, will throw a 404 Not Found error if the user does not exist
# returns user data
user = client.get_user(new_user_uid)

# gets a user by email or client_id
# will return user data type if the user exists, otherwise will return null
user_by_email = client.get_user_by_email('YOUR_EMAIL')

user_by_client_id = client.get_user_by_client_id('YOUR_CLIENT_ID')

Asset

The asset methods exposed by the sdk are used to create (mint) assets and retrieve assets from the Original API.

# prepare the new asset params
new_asset_data = {
    "user_uid": "324167489835",
    "client_id": "client_id_1",
    "collection_uid": "221137489875",
    "data": {
        "name": "Dave Starbelly",
        "unique_name": True,
        "image_url": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
        "store_image_on_ipfs": True,
        "description": "Friendly OpenSea Creature that enjoys long swims in the ocean.",
        "external_url": "https://openseacreatures.io/3",
        "attributes": [
            {
                "trait_type": "Base",
                "value": "Starfish"
            },
            {
                "trait_type": "Eyes",
                "value": "Big"
            },
            {
                "trait_type": "Aqua Power",
                "display_type": "boost_number",
                "value": 40
            },
            {
                "trait_type": "Stamina Increase",
                "display_type": "boost_percentage",
                "value": 10
            },
        ]
    }
}

# create a new asset
# returns the uid of the newly created asset
new_asset_uid = client.create_asset(**new_asset_data)

# gets an asset by uid, will throw a 404 Not Found error if the asset does not exist
asset = client.get_asset(new_asset_uid)

# gets assets by the owner uid
# will return a list of assets owned by the user
assets = client.get_asset_by_user_uid(user_uid)

# prepare the edit asset params
edit_asset_data = {
    "data": {
        "name": "Dave Starbelly Edited",
        "unique_name": True,
        "image_url": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
        "description": "Friendly OpenSea Creature that enjoys long swims in the ocean. Edited",
        "attributes": [
            {
                "trait_type": "Base",
                "value": "Starfish"
            },
        ]
    }
}

# edits an asset by uid, by passing in the new asset data
# returns success true or false
client.edit_asset(new_asset_uid, **edit_asset_data)

Collection

The collection methods exposed by the sdk are used to retrieve collection details from the Original API.

# gets a collection by uid, will throw a 404 Not Found error if the collection does not exist
# returns collection detail
collection = client.get_collection('221137489875')

Transfer

The transfer methods exposed by the sdk are used to transfer assets from one user to another wallet.

# create a transfer of an asset, by passing in transfer details
# returns the uid of the newly created transfer
transfer_uid = client.create_transfer(
  asset_uid = asset_uid,
  from_user_uid = user_uid,
  to_address = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
)

# gets a transfer by uid, will throw a 404 Not Found error if the transfer does not exist
transfer = client.get_transfer(transfer_uid)

# gets transfers by user uid
# will return a list of transfers for the user
transfers = client.get_transfers_by_user_uid(user_uid)

Burn

The burn methods exposed by the sdk are used to burn assets from a user's wallet.

# create a burn of an asset
# returns the uid of the newly created burn
burn_uid = client.create_burn(
  asset_uid=asset_uid,
  from_user_uid=user_uid,
)

# gets a burn by uid, will throw a 404 Not Found error if the burn does not exist
burn = client.get_burn(burn_uid)

# gets burns by user uid
burns = client.get_burn_by_user_uid(user_uid)

Deposit

The deposit methods exposed by the sdk are used to return the details for depositing assets.

# gets deposit details for a user
# returns the deposit details
deposit = client.get_deposit(user_uid)

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

original_sdk-1.1.2.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

original_sdk-1.1.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file original_sdk-1.1.2.tar.gz.

File metadata

  • Download URL: original_sdk-1.1.2.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/7.0.1 pkginfo/1.9.6 requests/2.31.0 requests-toolbelt/1.0.0 tqdm/4.66.1 CPython/3.10.13

File hashes

Hashes for original_sdk-1.1.2.tar.gz
Algorithm Hash digest
SHA256 6595d17d0b5f97399593f4335ef4eca4a661d0f14f90bb69d247f62a9080dbb3
MD5 b99059110117eb2407b5bd30726ee40d
BLAKE2b-256 3ee695df79f1fb1def14fd2035a7a4e241033db02c7fc6f6ed42d49ef331af63

See more details on using hashes here.

File details

Details for the file original_sdk-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: original_sdk-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/7.0.1 pkginfo/1.9.6 requests/2.31.0 requests-toolbelt/1.0.0 tqdm/4.66.1 CPython/3.10.13

File hashes

Hashes for original_sdk-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a7cb944f79fbc12fdbb584ae3aeb53299749862c552a9762e0f8e848a3e8a9bd
MD5 53ef19b3db97fbc3d74487a6c4a2650a
BLAKE2b-256 4f013d91adf8ac3625f90bded96f1017d89a2ce2da5c5dc4da8e54a04519b7a8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page