📘
TEOS User Guides
Contact CoreLedgerPrivacy Policy
TEOS API
TEOS API
  • 👋Welcome to TEOS API
  • Get started
  • TEOS API overview
    • Terms and concepts
      • Asset
      • Spark
      • Wallet
      • Supply
      • Warp
      • Invoice
      • Transaction
    • Architecture note
      • Tenant setup options
    • Authentication
    • Versioning
  • Using TEOS API
    • Postman examples
    • Rate limits
    • Dealing with blockchain transactions
      • How to get Ether for signing transactions
      • Transaction creation and submission
        • First transaction creation and submission for a new address on the private blockchain
    • Handling errors
      • 1xxxx codes
      • 2xxxx codes
      • 3xxxx codes
    • TEOS Events
    • Warp search
  • TEOS API references
    • TEOS API Swagger (OpenAPI)
  • Using additional APIs of TEOS Platform
    • User authentication flow with TEOS Authentication service and TMS
    • Device authorization flow with TxServer and TEOS Authentication service
    • Adding wallet to the TEOS Platform flow with TxServer and TEOS API
    • Using TxServer API
      • TxServer API (OpenAPI)
      • Key Pair Generation. Transaction Signing
      • Device Restoration
    • Using TEOS Authentication service
      • TEOS Authentication Service API
    • Using TMS API
      • TMS API Swagger (OpenAPI)
      • Handling errors
      • Changelog
    • Using Discovery Service
  • FAQ
  • Changelog
    • v0.9
    • Non-versioned changes
    • Previous versions (not supported)
  • Troubleshooting
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. TEOS API overview
  2. Terms and concepts

Supply

PreviousWalletNextWarp

Last updated 1 year ago

Was this helpful?

TEOS users can create supplies in order to trade their assets. Supply is an offer created by a user to get specific amount of sparks of desired asset in exchange to specific amount of sparks of offered asset.

Supplies are consumed by other TEOS users when they execute trades, or execute , where supplies existing on blockchain take part.

Supply object has the following structure:

{
    "SupplyId": "913896df-9959-4c93-8c59-05962c3ae7c7",
    "UniqueAssetIdOffered": "ae2abab0-f65b-4209-ba0b-9cc89a690ec4",
    "UniqueAssetIdDesired": "949edb18-54fa-4231-a205-27e1ea55acce",
    "OfferedAmount": "2000",
    "RemainingAmount": "2000",
    "RealRemaining": "1000",
    "DesiredAssetAmount": "20000",
    "ExchangeRate": "10",
    "OriginatorAddress": "0x1f68e487d04e4801f9025fb6f56835b18c49ff4a",
    "ReceiverAddress": "0x2b9a5a18cc542e9b1dc7c4965d1a2d78e664c04d",
    "ExpirationDate": "2022-03-21T23:27:18.0681707",
    "ExpirationOnBlock": "19439529",
    "TakeAll": true,
    "CreatedOn": "2024-03-07T12:27:32.1182341",
    "CreatedOnBlock": "19439510",
    "UpdatedOn": "2022-05-06 13:28:57.990",
    "CreatedInBlockchainOn": "2022-05-18T15:23:12.5246259+02:00"
  }

Main properties description:

  • UniqueAssetIdOffered - ID of an asset, which is offered for the exchange.

  • UniqueAssetIdDesired - ID of an asset to be received in exchange for the offered asset.

  • OfferedAmount - amount of offered asset in sparks, which was offered initially.

  • RemainingAmount - amount of offered asset in sparks, which is left at the moment.

  • RealRemaining - amount of offered asset at the moment in OriginatorAddress.

  • ExchangeRate - the amount of desired asset, received for 1 spark of offered asset (rate of the exchange).

  • OriginatorAddress - address of the issuer.

  • ReceiverAddress - address of the receiver of the desired asset.

  • ExpirationDate - date when supply becomes unavailable for trading (its status becomes "Inactive").

  • ExpirationOnBlock - the estimated number of block in blockchain, when supply becomes unavailable for trading (its status becomes "Inactive").

  • TakeAll - setup for withdrawing the whole amount of offered asset in sparks at one iteration (true).

  • CreatedInBlockchainOn - the timestamp when supply is written to blockchain. Until supply creation transaction is confirmed, this parameter is empty.

  • CreatedOnBlock - the number of block in blockchain, when supply was created.

CreatedOn is the parameter that indicates the timestamp when supply was created in TEOS Platform, while CreatedInBlockchainOn parameter indicates the timestamp when supply was written to blockchain.

Supply operations

TEOS user can create a supply by providing the following parameters in the request body:

  • UniqueAssetIdOffered

  • UniqueAssetIdDesired

  • OfferedAmount(in sparks)

  • ExchangeRate

  • OriginatorAddress

TEOS user can act as a middleware for the end users, therefore can provide issuer address separately on behalf of the end user.

  • ReceiverAddress

  • TakeAll (optional). If not provided, will be assigned automatically with "false" value in the response.

  • ExpirationDate / ExpirationOnBlock

ExpirationDate and ExpirationOnBlock parameters are mutually exclusive: TEOS user must provide only one of them. The other parameter will be returned in the response.

TEOS user can change exchange rate of a supply by providing the corresponding SupplyId and new ExchangeRate.

TEOS user can change supply expiration by providing corresponding SupplyId, new ExpirationDate or new ExpirationOnBlock. ExpirationDate and ExpirationBlock parameters are mutually exclusive: TEOS user must provide either of them.

TEOS user can restock a supply by providing corresponding SupplyId and OfferedAmount in sparks.

OfferedAmount must indicate the amount, to which the supply must be restocked.

TEOS user can delete a supply by providing corresponding SupplyId. After the supply is deleted, it will be excluded from WARP search.

The method can be called for the list of SupplyIds.

warps