Supply
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 warps, where supplies existing on blockchain take part.
Supply object has the following structure:
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.
Last updated