Structures#

All structures in Ride are built-in — you cannot create your own structures. All structures have constructors.

Let’s see an example of a code that creates an instance of the IntegerEntry structure and reads its key and value:

let data = IntegerEntry("Age", 33)
let key  = data.key
let val = data.value

Script Actions#

Script actions are executed, that is, they make changes on the blockchain only if they are included in the resulting expression of the callable function. See more details in the callable function article.

Script Actions#

Action

Description

BinaryEntry

Add or modify a binary entry of the account data storage.

BooleanEntry

Add or modify a boolean entry.

Burn

Burn a token.

DeleteEntry

Delete an entry.

IntegerEntry

Add or modify an integer entry.

Issue

Issue a token.

Lease

Lease.

LeaseCancel

Cancel lease.

Reissue

Reissue a token.

ScriptTransfer

Transfer a token.

SponsorFee

Set up a sponsorship.

StringEntry

Add or modify a string entry.

Available script actions depend on the standard library version used.

BinaryEntry#

BinaryEntry is a structure that sets key and value of binary entry account data storage. Adding or changing an entry is performed only if the structure is included in the callable function result>`.

Constructor

BinaryEntry(key: String, value: ByteVector)

Fields

BinaryEntry Fields#

#

Name

Data type

Description

\(1\)

key

String

Entry key. The maximum size is \(400\) bytes.

\(2\)

value

ByteVector

Entry value. The maximum size is \(5\) Kbytes.

BooleanEntry#

BooleanEntry is a structure that sets the key and value of the account data storage boolean entry. Adding or changing an entry is performed only if the structure is included in the callable function result>`.

Constructor

BooleanEntry(key: String, value: Boolean)

Fields

BooleanEntry Fields#

#

Name

Data type

Description

\(1\)

key

String

Entry key. The maximum size is \(400\) bytes.

\(2\)

value

Boolean

Entry value.

Burn#

Burn is a structure that sets the parameters of the token burning. The token burning is performed only if the structure is included in the callable function result>`. If the token is a smart asset, the asset script verifies the Burn action as if it were BurnTransaction with the fee of \(0\) and the version of \(0\). If the asset script denies the action, then the transaction that invoked the dApp script is either denied or saved on the blockchain as failed, see the transaction validation.

Constructor

Burn(assetId: ByteVector, quantity: Int)

Fields

Burn Fields#

#

Name

Data type

Description

\(1\)

assetId

ByteVector

ID of the token to burn.

\(2\)

quantity

Int

Amount of the token.

DeleteEntry#

DeleteEntry is a structure that sets the parameters of deletion of entry from the account data storage. Deleting an entry is performed only if the structure is included in the callable function result>`.

Constructor

DeleteEntry(key: String)

Fields

DeleteEntry Fields#

#

Name

Data type

Description

\(1\)

key

String

Entry key. The maximum size is \(400\) bytes.

Example

{-# STDLIB_VERSION 5 #-}
{-# SCRIPT_TYPE ACCOUNT #-}

@Callable(inv)
func default() = {
 (
   [
     DeleteEntry(inv.caller.toString())
   ],
   unit
 )
}

IntegerEntry#

IntegerEntry is a structure that sets the key and value of account data storage integer entry. Adding or changing an entry is performed only if the structure is included in the callable function result>`.

Constructor

IntegerEntry(key: String, value: Int)

Fields

IntegerEntry Fields#

#

Name

Data type

Description

\(1\)

key

String

Entry key. The maximum size is \(400\) bytes.

\(2\)

value

Int

Entry value.

Issue#

Issue is a structure that sets the parameters of the token issue. The token issue is performed only if the structure is included in the callable function result>`. The minimum fee for an invoke script transaction is increased by \(1\) DecentralCoin for each issued asset that is not NFT. You can get the ID of the issued token using the calculateAssetId function.

Constructor

Issue(name: String, description: String, quantity: Int, decimals: Int, isReissuable: Boolean, compiledScript: Script|Unit, nonce: Int)

or

Issue(name: String, description: String, quantity: Int, decimals: Int, isReissuable: Boolean)

In the second case, compiledScript = unit and nonce = 0 values are inserted automatically.

Fields

Issue Fields#

#

Name

Data type

Description

\(1\)

name

String

Token name.

\(2\)

description

String

Token description.

\(3\)

quantity

Int

Amount of the token. Set to \(1\) for NFT.

\(4\)

decimals

Int

Number of digits in decimal part. Set to \(0\) for NFT.

\(5\)

isReissuable

Boolean

Reissue ability flag. Set to \(0\) for NFT.

\(6\)

compiledScript

Script | Unit

Set it to unit. Smart asset issue is currently unavailable.

\(7\)

nonce

Int

Nonce that is used for token ID generation. If the callable function issues several tokens with the same parameters, you should use different nonce.

Example

Regular Token Issue

Issue("RegularToken", "This is an ordinary token", 10000, 2, true)

The structure sets the following parameters of token:

  • Name: RegularToken

  • Description: This is an ordinary token

  • Amount of tokens to issue: \(100\) (value of \(10 000\) is specified in the minimum fraction — “cents”)

  • Amount of decimals: \(2\)

  • Reissue ability: yes

Multiple Token Issue

(
 [
   Issue("RegularToken", "This is an ordinary token", 10000, 2, true, unit, 0),
   Issue("RegularToken", "This is an ordinary token", 10000, 2, true, unit, 1)
 ],
 unit
)

NFT Issue

Issue("UberToken", "The ultimate token.", 1, 0, false)

The structure sets the following parameters of token:

  • Name: UberToken

  • Description: The ultimate token.

  • Amount of tokens to issue: \(1\)

  • Amount of decimals: \(0\)

  • Reissue ability: no

Lease#

Lease is a structure that sets the lease parameters. The lease is performed only if the structure is included in the callable function result>`. More about lease. You can get the lease ID using the calculateLeaseId function.

Constructor

Lease(recipient: Address|Alias, amount: Int, nonce: Int)

or

Lease(recipient: Address|Alias, amount: Int)

In the second case, nonce = \(0\) is inserted automatically.

Fields

Lease Fields#

#

Name

Data type

Description

\(1\)

recipient

Address | Alias

Lessee address or alias.

\(2\)

amount

Int

Amount of DecentralCoins to lease (that is, amount of Decentralites multiplied by \(10^{8}\)).

\(7\)

nonce

Int

Nonce that is used for lease ID generation. If the callable function creates several leases with the same parameters, you should use different nonces.

Example

{-# STDLIB_VERSION 5 #-}
{-# CONTENT_TYPE DAPP #-}
{-# SCRIPT_TYPE ACCOUNT #-}

@Callable(i)
func foo() = {
 let lease = Lease(Alias("merry"),100000000)
 let id = calculateLeaseId(lease)
 (
   [
     lease,
     BinaryEntry("lease", id)
   ],
   unit
 )
}

LeaseCancel#

LeaseCancel is a structure that sets the lease cancellation parameters. The lease cancellation is performed only if the structure is included in the callable function result>`.

Constructor

LeaseCancel(leaseId: ByteVector)

Fields

LeaseCancel Fields#

#

Name

Data type

Description

\(1\)

leaseId

ByteVector

Lease ID

Reissue#

Reissue is a structure that sets the parameters of the token reissue. The token reissue is performed only if the structure is included in the callable function result>`. The token reissue is only available for an asset that is issued by a dApp account. If the token is a smart asset, the asset script verifies the Reissue action as if it were ReissueTransaction with the fee of 0 and the version of 0. If the asset script denies the action, then the transaction that invoked the dApp script is either denied or saved on the blockchain as failed, see the transaction validation.

Constructor

Reissue(assetId: ByteVector, quantity: Int, isReissuable: Boolean)

Fields

Reissue Fields#

#

Name

Data type

Description

\(1\)

assetId

ByteVector

ID of the token to reissue.

\(2\)

quantity

Int

Amount of the token.

\(3\)

isReissuable

Boolean

Reissue ability flag.

ScriptTransfer#

ScriptTransfer is a structure that sets the parameters of the token transfer. The token transfer is performed only if the structure is included in the callable function result>`. If the token is a smart asset, the asset script verifies the ScriptTransfer action as if it were TransferTransaction with the fee of \(0\) and the version of \(0\). If the asset script denies the action, then the transaction that invoked the dApp script is either denied or saved on the blockchain as failed, see the transaction validation.

Constructor

ScriptTransfer(recipient: Address|Alias, amount: Int, asset: ByteVector|Unit)

Fields

ScriptTransfer Fields#

#

Name

Data type

Description

\(1\)

recipient

Address | Alias

address or the alias of a recipient of tokens.

\(2\)

amount

Int

Number of tokens.

\(3\)

asset

ByteVector | Unit

ID of the token.

SponsorFee#

SponsorFee is a structure that sets up sponsorship. For information about sponsorship, see the sponsored fee article. The sponsorship setup is performed only if the structure is included in the resulting expression of the callable function. See details in the callable function article. The sponsorship setup is only available if the asset is issued by a dApp account (by the same script invocation as well) and is not a smart asset.

Constructor

SponsorFee(assetId: ByteVector, minSponsoredAssetFee: Int|Unit)

Fields

SponsorFee Fields#

#

Name

Data type

Description

\(1\)

assetId

ByteVector

Asset ID

\(2\)

minSponsoredAssetFee

ByteVector | Unit

Amount of sponsored asset that is equivalent to 0.001 DecentralCoins, specified in the minimum fraction (“cent”) of the sponsored asset. unit — disable the sponsorship.

Example

{-# STDLIB_VERSION 5 #-}
{-# CONTENT_TYPE DAPP #-}
{-# SCRIPT_TYPE ACCOUNT #-}

@Callable(i)
func issueAndSponsor() = {
 let issue = Issue("Spring", "", 100000, 2, true, unit, 0)
 let id = calculateAssetId(issue)
 (
   [
     issue,
     SponsorFee(id, 300)
   ],
   unit
 )
}

The issueAndSponsor callable function issues an asset and enables sponsorship. The minimum fee in sponsored assets is \(3\) Spring.

StringEntry#

StringEntry is a structure that sets key and value of account data storage string entry. Adding or changing an entry is performed only if the structure is included in the callable function result>`.

Constructor

BinaryEntry(key: String, value: String)

Fields

StringEntry Fields#

#

Name

Data type

Description

\(1\)

key

String

Entry key. The maximum size is \(400\) bytes.

\(2\)

value

String

Entry value. The maximum size is \(5\) Kbytes.

Common Structures#

Common Structures#

Name

Description

Address

Account address.

Alias

Alias.

Asset

Token info.

AssetPair

Pair of tokens of an order within the order structure.

AttachedPayment

Payment attached to the script invocation and available to the callable function.

BalanceDetails

Account balance in DecentralCoins.

BlockInfo

Block header.

Invocation

Script invocation fields that the callable function can use.

Order

Order

Transfer

Transfer within the MassTransferTransaction structure.

Address#

Structure of an address.

Constructor

Address(bytes: ByteVector)

Fields

Address Fields#

#

Name

Data type

Description

\(1\)

bytes

ByteVector

Array of bytes of the address.

Example

Get all types of balance in DecentralCoins for the current account (in a dApp script or an account script):

decentralchainBalance(this)

For any account:

let address=base58'3N4iKL6ikwxiL7yNvWQmw7rg3wGna8uL6LU'
decentralchainBalance(Address(address))

Get an entry value by key from the account data storage:

let address2=base58'3N6dFJ6XBQsWz1VV1i5aW4CyYpVKc39MUGZ'
getBoolean(Address(address2),"allow_orders")

Convert the address that invoked the function to a base58 string:

{-# STDLIB_VERSION 5 #-}
{-# CONTENT_TYPE DAPP #-}
{-# SCRIPT_TYPE ACCOUNT #-}

@Callable(i)
func foo(question: String) = {
 let callerAddress = toBase58String(i.caller.bytes)
 ...
}

Check the recipient’s address in the transfer transaction:

{-# STDLIB_VERSION 5 #-}
{-# CONTENT_TYPE EXPRESSION #-}
{-# SCRIPT_TYPE ACCOUNT #-}

# Bank dApp address
let BANK = base58'3MpFRn3X9ZqcLimFoqNeZwPBnwP7Br5Fmgs'

match (tx) {
 case t: TransferTransaction => addressFromRecipient(t.recipient).bytes == BANK
 case _ => false
}

Alias#

Structure of an alias.

Constructor

Alias(alias: String)

Fields

Alias Fields#

#

Name

Data type

Description

\(1\)

alias

String

Alias

Example

let alias = Alias("merry")
addressFromRecipient(alias)

Asset#

Structure of a token. The structure is returned by the assetInfo built-in function.

Constructor

Asset(id: ByteVector, quantity: Int, decimals: Int, issuer: Address, issuerPublicKey: ByteVector, reissuable: Boolean, scripted: Boolean, minSponsoredFee: Int|Unit, name: String, description: String)

Fields

Asset Fields#

#

Name

Data type

Description

\(1\)

id

ByteVector

token ID.

\(2\)

quantity

Int

Amount of issued token, multiplied by \(10^{decimals}\). Up to \(9 223 372 036 854 775 806\).

\(3\)

decimals

Int

Number of decimal places, \(0\) to \(8\).

\(4\)

issuer

Address

address of the account that issued a token.

\(5\)

issuerPublicKey

ByteVector

Public key of the account that issued a token.

\(6\)

reissuable

Boolean

true — token can be reissued, false — cannot be reissued.

\(7\)

scripted

Boolean

true — smart asset, false — regular token.

\(8\)

minSponsoredFee

Int | Unit

Amount of asset that is equivalent to \(0.001\) DecentralCoins (\(100,000\) Decentralites), specified in the minimum fraction (“cents”) of asset. See the Sponsored fee article. unit: sponsorship is disabled.

\(9\)

name

String

Token name, up to \(16\) characters.

\(10\)

description

String

Token description, up to \(1000\) characters.

Example

Get the account balance in a given asset:

let address=base58'3Mw48B85LvkBUhhDDmUvLhF9koAzfsPekDb'
let assetId=base58'GpxmxorKXLz1V7xootrvGyFgqP2tTTBib5HEm8QGZTHX'
assetBalance(Address(address), assetId)

AssetPair#

Structure of a pair of tokens of an order within the Order structure.

Constructor

AssetPair(amountAsset: ByteVector|Unit, priceAsset: ByteVector|Unit)

Fields

AssetPair Fields#

#

Name

Data type

Description

\(1\)

amountAsset

ByteVector | Unit

The first token of a pair.

\(2\)

priceAsset

ByteVector | Unit

The second token of a pair.

Example

Get the account balance in a given asset:

let address=base58'3Mw48B85LvkBUhhDDmUvLhF9koAzfsPekDb'
let assetId=base58'GpxmxorKXLz1V7xootrvGyFgqP2tTTBib5HEm8QGZTHX'
assetBalance(Address(address), assetId)

AttachedPayment#

Structure of a payment attached to the script invocation and available to the callable function. The structure is used in:

Constructor

AttachedPayment(assetId: ByteVector|Unit, amount: Int)

Fields

AttachedPayment Fields#

#

Name

Data type

Description

\(1\)

assetId

ByteVector | Unit

ID of a token.

\(2\)

amount

Int

Payment amount.

BalanceDetails#

Structure that contains DecentralCoins balances of account. The structure is returned by the decentralchainBalance built-in function. For description of balance types, see the account balance article.

Constructor

BalanceDetails(available: Int, regular: Int, generating: Int, effective: Int)

Fields

BalanceDetails Fields#

#

Name

Data type

Description

\(1\)

available

Int

Available balance.

\(2\)

regular

Int

Regular balance.

\(3\)

generating

Int

Generating balance.

\(4\)

effective

Int

Effective balance.

All balances are given in Decentralites.

BlockInfo#

Structure containing block headers. The structure is returned by the blockInfoByHeight built-in function.

Constructor

BlockInfo(timestamp: Int, height: Int, baseTarget: Int, generationSignature: ByteVector, generator: Address, generatorPublicKey: ByteVector, vrf: ByteVector|Unit)

Fields

BlockInfo Fields#

#

Name

Data type

Description

\(1\)

timestamp

Int

Block timestamp.

\(2\)

height

Int

Block height.

\(3\)

baseTarget

Int

Base target.

\(4\)

generationSignature

ByteVector

Generation signature.

\(5\)

generator

Address

address of the account that created a block.

\(6\)

generatorPublicKey

ByteVector

Public key of the account that created a block.

\(7\)

vrf

ByteVector | Unit

VRF for block version 5, unit otherwise.

Invocation#

Structure that contains the fields of the script invocation that the callable function can use.

Constructor

Invocation(caller: Address, callerPublicKey: ByteVector, originCaller: Address, originCallerPublicKey: ByteVector, payments: List[AttachedPayment], transactionId: ByteVector, fee: Int, feeAssetId: ByteVector|Unit)

Fields

The field values depend on how the callable function is invoked. If the callable function is invoked by an invoke script transaction:

Invocation Fields 1#

#

Name

Data type

Description

\(1\)

caller

Address

address of the account that sent the invoke script transaction.

\(2\)

callerPublicKey

ByteVector

Public key of the account that sent the invoke script transaction.

\(3\)

originCaller

Address

Duplicates the caller field.

\(4\)

originCallerPublicKey

ByteVector

Duplicates the callerPublicKey field.

\(5\)

payments

List [AttachedPayment]

Payments indicated in the invoke script transaction.

\(6\)

transactionId

ByteVector

ID of the invoke script transaction.

\(7\)

fee

Int

Transaction fee.

\(8\)

feeAssetId

ByteVector | Unit

ID of the fee token.

If the callable function is invoked by the invoke or reentrantInvoke function (see the dApp-to-dApp invocation article):

Invocation Fields 2#

#

Name

Data type

Description

\(1\)

caller

Address

address of the dApp that invokes the callable function.

\(2\)

callerPublicKey

ByteVector

Public key of the dApp that invokes the callable function.

\(3\)

originCaller

Address

Address of the account that sent the Invoke Script transaction.

\(4\)

originCallerPublicKey

ByteVector

Public key of the account that sent the Invoke Script transaction.

\(5\)

payments

List [AttachedPayment]

Payments indicated in the invoke or reentrantInvoke function.

\(6\)

transactionId

ByteVector

ID of the Invoke Script transaction.

\(7\)

fee

Int

Transaction fee.

\(8\)

feeAssetId

ByteVector | Unit

ID of the fee token.

The originCaller, originCallerPublicKey, transactionId, fee, and feeAssetId values are the same for all dApp-to-dApp invocations within a single Invoke Script transaction.

Example

The following function checks that the first payment in the Invoke Script transaction is at least 1 DecentralCoin or 5 in the specified asset.

{-# STDLIB_VERSION 5 #-}
{-# CONTENT_TYPE DAPP #-}
{-# SCRIPT_TYPE ACCOUNT #-}

func isPaymentOk(i: Invocation) = {
 let acceptableAssetId = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg'
 if (size(i.payments) == 0) then {
   throw("Payment not attached")
 } else {
   let p = i.payments[0]
   match p.assetId {
     case assetId: ByteVector => assetId == acceptableAssetId && p.amount >= 500000000
     case _ => p.amount >= 100000000
   }
 }
}

@Callable(i)
func foo() = {
 if isPaymentOk(i) then ([],unit) else throw("Wrong payment amount or asset")
}

Order#

Structure of an order dApp-to-dApp invocation. The structure is used:

Constructor

Order(id: ByteVector, matcherPublicKey: ByteVector, assetPair: AssetPair, orderType: Buy|Sell, price: Int, amount: Int, timestamp: Int, expiration: Int, matcherFee: Int, matcherFeeAssetId: ByteVector|Unit, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

Order Fields#

#

Name

Data type

Description

\(1\)

id

ByteVector

ID of an order.

\(2\)

matcherPublicKey

ByteVector

Public key of a matcher.

\(3\)

assetPair

AssetPair

Pair of tokens.

\(4\)

orderType

Buy|Sell

Type of an order — selling or buying.

\(5\)

price

Int

Price of a token to exchange.

\(6\)

amount

Int

Number of tokens to exchange.

\(7\)

timestamp

Int

Unix time of the validation of an order by a matcher.

\(8\)

expiration

Int

Unix time when an uncompleted order will be cancelled.

\(9\)

matcherFee

Int

Transaction fee.

\(10\)

matcherFeeAssetId

ByteVector | Unit

Token of a transaction fee. It can only be DecentralCoins.

\(11\)

sender

Address

address of the sender of an order.

\(12\)

senderPublicKey

ByteVector

Public key of the sender of an order.

\(13\)

bodyBytes

ByteVector

Array of bytes of an order.

\(14\)

proofs

List [ByteVector]

Array of proofs.

Example

The script below enables buying from a sender’s account:

  • Only the specified asset.

  • Only at a given price.

  • Only for DecentralCoins.

{-# STDLIB_VERSION 5 #-}
{-# CONTENT_TYPE EXPRESSION #-}
{-# SCRIPT_TYPE ACCOUNT #-}

let myAssetId = base58'8LLpj6yQLUu37KUt3rVo1S69j2gWMbgbM6qqgt2ac1Vb'

match tx {
  case o: Order =>
   let isDecentralChainPriceAsset = !isDefined(o.assetPair.priceAsset)
   let rightPair = (o.assetPair.amountAsset == myAssetId) && isDecentralChainPriceAsset
   sigVerify(o.bodyBytes, o.proofs[0], o.senderPublicKey)
   && rightPair
   && o.price == 500000
   && o.orderType == Buy
  case _ => false
}

Transfer#

Structure of a single transfer within the MassTransferTransaction structure.

Constructor

Transfer(recipient: Address|Alias, amount: Int)

Fields

Transfer Fields#

#

Name

Data type

Description

\(1\)

recipient

Address | Alias

address of a recipient of tokens.

\(2\)

amount

Int

Number of tokens.

Transaction Structures#

Tokenization#

Tokenization#

Transaction type ID

Name

Description

\(3\)

IssueTransaction

Structure of issue transaction.

\(5\)

ReissueTransaction

Structure of reissue transaction.

\(6\)

BurnTransaction

Structure of burn transaction.

\(15\)

SetAssetScriptTransaction

Structure of set asset script transaction.

\(17\)

UpdateAssetInfoTransaction

Structure of update asset info transaction.

IssueTransaction#

Structure of an issue transaction.

Constructor

IssueTransaction(quantity: Int, name: String, description: String, reissuable: Boolean, decimals: Int, script: ByteVector|Unit, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

IssueTransaction Fields#

#

Name

Data type

Description

\(1\)

quantity

Int

Amount of the token.

\(2\)

name

String

Token name.

\(3\)

description

String

Token description.

\(4\)

reissuable

Boolean

Reissue ability flag.

\(5\)

decimals

Int

Number of digits in decimal part.

\(6\)

script

ByteVector | Unit

Script that must be set for the generated token.

\(7\)

id

ByteVector

Transaction ID.

\(8\)

fee

Int

Transaction fee.

\(9\)

timestamp

Int

Transaction timestamp.

\(10\)

version

Int

Transaction version.

\(11\)

sender

Address

address of the transaction sender.

\(12\)

senderPublicKey

ByteVector

Account public key of the transaction sender.

\(13\)

bodyBytes

ByteVector

Transaction body bytes.

\(14\)

proofs

List [ByteVector]

Array of proofs.

ReissueTransaction#

Structure of a reissue transaction.

Constructor

ReissueTransaction(quantity: Int, assetId: ByteVector, reissuable: Boolean, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

ReissueTransaction Fields#

#

Name

Data type

Description

\(1\)

quantity

Int

Amount of the token.

\(2\)

assetId

ByteVector

token ID.

\(3\)

reissuable

Boolean

Reissue flag.

\(4\)

id

ByteVector

Transaction ID.

\(5\)

fee

Int

Transaction fee.

\(6\)

timestamp

Int

Transaction timestamp.

\(7\)

version

Int

Transaction version.

\(8\)

sender

Address

address of the transaction sender.

\(9\)

senderPublicKey

ByteVector

Public key of the transaction sender.

\(10\)

bodyBytes

ByteVector

Transaction body bytes.

\(11\)

proofs

List [ByteVector]

Proofs.

BurnTransaction#

Structure of an burn transaction.

Constructor

BurnTransaction(quantity: Int, assetId: ByteVector, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

BurnTransaction Fields#

#

Name

Data type

Description

\(1\)

quantity

Int

Amount of the token to burn.

\(2\)

assetId

ByteVector

ID of the token to burn.

\(3\)

id

ByteVector

Transaction ID.

\(4\)

fee

Int

Transaction fee.

\(5\)

timestamp

Int

Transaction timestamp.

\(6\)

version

Int

Transaction version.

\(7\)

sender

Address

address of the transaction sender.

\(8\)

senderPublicKey

ByteVector

Public key of the transaction sender.

\(9\)

bodyBytes

ByteVector

Transaction body bytes.

\(10\)

proofs

List [ByteVector]

Array of proofs.

SetAssetScriptTransaction#

Structure of an set asset script transaction.

Constructor

SetAssetScriptTransaction(script: ByteVector|Unit, assetId: ByteVector, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

SetAssetScriptTransaction Fields#

#

Name

Data type

Description

\(1\)

script

ByteVector | Unit

Asset script.

\(2\)

assetId

ByteVector

token ID.

\(3\)

id

ByteVector

Transaction ID.

\(4\)

fee

Int

Transaction fee.

\(5\)

timestamp

Int

Transaction timestamp.

\(6\)

version

Int

Transaction version.

\(7\)

sender

Address

address of the transaction sender.

\(8\)

senderPublicKey

ByteVector

Public key of the transaction sender.

\(9\)

bodyBytes

ByteVector

Transaction body bytes.

\(10\)

proofs

List [ByteVector]

Proofs.

UpdateAssetInfoTransaction#

Structure of an update asset info transaction.

Constructor

UpdateAssetInfoTransaction(name: String, assetId: ByteVector, description: String, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

UpdateAssetInfoTransaction Fields#

#

Name

Data type

Description

\(1\)

name

String

Name of the token.

\(2\)

assetId

ByteVector

token ID.

\(3\)

description

String

Description of the token.

\(4\)

id

ByteVector

Transaction ID.

\(5\)

fee

Int

Transaction fee.

\(6\)

timestamp

Int

Transaction timestamp.

\(7\)

version

Int

Transaction version.

\(8\)

sender

Address

Address of a transaction sender.

\(9\)

senderPublicKey

ByteVector

Account public key of a sender.

\(10\)

bodyBytes

ByteVector

Transaction body bytes.

\(11\)

proofs

List [ByteVector]

Array of proofs.

Usage#

Usage#

Transaction type ID

Name

Description

\(4\)

TransferTransaction

Structure of transfer transaction.

\(7\)

ExchangeTransaction

Structure of exchange transaction.

\(10\)

CreateAliasTransaction

Structure of create alias transaction.

\(11\)

MassTransferTransaction

Structure of mass transfer transaction.

\(12\)

DataTransaction

Structure of data transaction.

\(13\)

SetScriptTransaction

Structure of set script transaction.

\(16\)

InvokeScriptTransaction

Structure of invoke script transaction.

TransferTransaction#

Structure of an transfer transaction.

Constructor

TransferTransaction(feeAssetId: ByteVector|Unit, amount: Int, assetId: ByteVector|Unit, recipient: Address|Alias, attachment: ByteVector, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

TransferTransaction Fields#

#

Name

Data type

Description

\(1\)

feeAssetId

ByteVector | Unit

Token to pay the commission.

\(2\)

amount

Int

Amount of tokens to transfer.

\(3\)

assetId

ByteVector | Unit

ID of a token.

\(4\)

recipient

Address | Alias

Address or alias of the recipient.

\(5\)

attachment

ByteVector

Arbitrary data attached to transfer. The maximum data size is \(140\) bytes.

\(6\)

id

ByteVector

Transaction ID.

\(7\)

fee

Int

Transaction fee.

\(8\)

timestamp

Int

Transaction timestamp.

\(9\)

version

Int

Transaction version.

\(10\)

sender

Address

address of a transaction sender.

\(11\)

senderPublicKey

ByteVector

Account public key of a sender.

\(12\)

bodyBytes

ByteVector

Transaction body bytes.

\(13\)

proofs

List [ByteVector]

Array of proofs.

ExchangeTransaction#

Structure of an exchange transaction.

Constructor

ExchangeTransaction(buyOrder: Order, sellOrder: Order, price: Int, amount: Int, buyMatcherFee: Int, sellMatcherFee: Int, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

ExchangeTransaction Fields#

#

Name

Data type

Description

\(1\)

buyOrder

Order

Token purchase order.

\(2\)

sellOrder

Order

Token sell order.

\(3\)

price

Int

Price of exchanging token.

\(4\)

amount

Int

Amount of exchanging tokens.

\(5\)

buyMatcherFee

Int

Matcher’s purchase fee.

\(6\)

sellMatcherFee

Int

Matcher’s sell fee.

\(7\)

id

ByteVector

Transaction ID.

\(8\)

fee

Int

Transaction fee.

\(9\)

timestamp

Int

Transaction timestamp.

\(10\)

version

Int

Transaction version.

\(11\)

sender

Address

address of a transaction sender.

\(12\)

senderPublicKey

ByteVector

Account public key of a sender.

\(13\)

bodyBytes

ByteVector

Transaction body bytes.

\(14\)

proofs

List [ByteVector]

Array of proofs.

CreateAliasTransaction#

Structure of a create alias transaction.

Constructor

CreateAliasTransaction(alias: String, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

CreateAliasTransaction Fields#

#

Name

Data type

Description

\(1\)

alias

String

Alias.

\(3\)

id

ByteVector

Transaction ID.

\(4\)

fee

Int

Transaction fee.

\(5\)

timestamp

Int

Transaction timestamp.

\(6\)

version

Int

Transaction version.

\(7\)

sender

Address

address of the transaction sender.

\(8\)

senderPublicKey

ByteVector

Public key of the transaction sender.

\(9\)

bodyBytes

ByteVector

Transaction body bytes.

\(10\)

proofs

List [ByteVector]

Array of proofs.

MassTransferTransaction#

Structure of a mass transfer transaction.

Constructor

MassTransferTransaction(assetId: ByteVector|Unit, totalAmount: Int, transfers: List[Transfer], transferCount: Int, attachment: ByteVector, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

MassTransferTransaction Fields#

#

Name

Data type

Description

\(1\)

assetId

ByteVector | Unit

token ID.

\(2\)

totalAmount

Int

Amount of the token to be transferred.

\(3\)

transfers

List [Transfer]

Transfers.

\(4\)

transferCount

Int

Number of transfers.

\(5\)

attachment

ByteVector

Optional data attached to the transaction. This field is often used to attach a comment to the transaction. The maximum data size is \(140\) bytes.

\(6\)

id

ByteVector

Transaction ID.

\(7\)

fee

Int

Transaction fee.

\(8\)

timestamp

Int

Transaction timestamp.

\(9\)

version

Int

Transaction version.

\(10\)

sender

Address

address of the transaction sender.

\(11\)

senderPublicKey

ByteVector

Public key of the transaction sender.

\(12\)

bodyBytes

ByteVector

Transaction body bytes.

\(13\)

proofs

List [ByteVector]

Proofs.

DataTransaction#

Structure of a data transaction.

Constructor

DataTransaction(data: List[BinaryEntry|BooleanEntry|DeleteEntry|IntegerEntry|StringEntry], id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

DataTransaction Fields#

#

Name

Data type

Description

\(1\)

data

List [BinaryEntry | BooleanEntry | DeleteEntry | IntegerEntry | StringEntry]

Transaction’s data array.

\(2\)

id

ByteVector

Transaction ID.

\(3\)

fee

Int

Transaction fee.

\(4\)

timestamp

Int

Transaction timestamp.

\(5\)

version

Int

Transaction version.

\(6\)

sender

Address

address of a transaction sender.

\(7\)

senderPublicKey

ByteVector

Account public key of a sender.

\(8\)

bodyBytes

ByteVector

Transaction body bytes.

\(9\)

proofs

List [ByteVector]

Array of proofs.

SetScriptTransaction#

Structure of a set script transaction.

Constructor

SetScriptTransaction(script: ByteVector|Unit, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

SetScriptTransaction Fields#

#

Name

Data type

Description

\(1\)

script

ByteVector | Unit

Account script or dApp script.

\(2\)

id

ByteVector

Transaction ID.

\(3\)

fee

Int

Transaction fee.

\(4\)

timestamp

Int

Transaction timestamp.

\(5\)

version

Int

Transaction version.

\(6\)

sender

Address

address of the transaction sender.

\(7\)

senderPublicKey

ByteVector

Public key of the transaction sender.

\(8\)

bodyBytes

ByteVector

Transaction body bytes.

\(9\)

proofs

List [ByteVector]

Proofs.

InvokeScriptTransaction#

Structure of an invoke script transaction.

Constructor

InvokeScriptTransaction(dApp: Address|Alias, payments: List[AttachedPayments], feeAssetId: ByteVector|Unit, function: String, args: List[Boolean|ByteVector|Int|String|List[Boolean|ByteVector|Int|String]], id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

InvokeScriptTransaction Fields#

#

Name

Data type

Description

\(1\)

dApp

Address | Alias

address or alias of the account which is calling a function.

\(2\)

payments

List [AttachedPayment]

Payments attached to the transaction.

\(3\)

feeAssetId

ByteVector | Unit

token to pay the commission.

\(4\)

function

String

Name of the callable function.

\(5\)

args

List [Boolean | ByteVector | Int | String | List [Boolean | ByteVector | Int | String]]

Parameters of the callable function.

\(6\)

id

ByteVector

Transaction ID.

\(7\)

fee

Int

Transaction fee.

\(8\)

timestamp

Int

Transaction timestamp.

\(9\)

version

Int

Transaction version.

\(10\)

sender

Address

address of the transaction sender.

\(11\)

senderPublicKey

ByteVector

Account public key of the transaction sender.

\(12\)

bodyBytes

ByteVector

Transaction body bytes.

\(13\)

proofs

List [ByteVector]

Array of proofs.

Network#

Network#

Transaction type ID

Name

Description

\(8\)

LeaseTransaction

Structure of lease transaction.

\(9\)

LeaseCancelTransaction

Structure of lease cancel transaction.

\(14\)

SponsorFeeTransaction

Structure of sponsor fee transaction.

LeaseTransaction#

Structure of a lease transaction.

Constructor

LeaseTransaction(amount: Int, recipient: Address|Alias, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

LeaseTransaction Fields#

#

Name

Data type

Description

\(1\)

amount

Int

Amount of the token to lease.

\(2\)

recipient

Address | Alias

address or alias of the leasing recipient.

\(3\)

id

ByteVector

Transaction ID.

\(4\)

fee

Int

Transaction fee.

\(5\)

timestamp

Int

Transaction timestamp.

\(6\)

version

Int

Transaction version.

\(7\)

sender

Address

address of a transaction sender.

\(8\)

senderPublicKey

ByteVector

Account public key of a sender.

\(9\)

bodyBytes

ByteVector

Transaction body bytes.

\(10\)

proofs

List [ByteVector]

Array of proofs.

LeaseCancelTransaction#

Structure of a lease cancel transaction.

Constructor

LeaseCancelTransaction(leaseId: ByteVector, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

LeaseCancelTransaction Fields#

#

Name

Data type

Description

\(1\)

leaseId

ByteVector

Leasing ID.

\(2\)

id

ByteVector

Transaction ID.

\(3\)

fee

Int

Transaction fee.

\(4\)

timestamp

Int

Transaction timestamp.

\(5\)

version

Int

Transaction version.

\(6\)

sender

Address

address of the transaction sender.

\(7\)

senderPublicKey

ByteVector

Public key of the transaction sender.

\(8\)

bodyBytes

ByteVector

Transaction body bytes.

\(9\)

proofs

List [ByteVector]

Proofs.

SponsorFeeTransaction#

Structure of a sponsor fee transaction.

Constructor

SponsorFeeTransaction(assetId: ByteVector, minSponsoredAssetFee: Int|Unit, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])

Fields

SponsorFeeTransaction Fields#

#

Name

Data type

Description

\(1\)

assetId

ByteVector

token ID.

\(2\)

minSponsoredAssetFee

Int | Unit

Amount of asset that is equivalent to 0.001 DecentralCoins (100,000 Decentralites): an integer value specified in atomic units. unit – disable sponsorship.

\(3\)

id

ByteVector

Transaction ID.

\(4\)

fee

Int

Transaction fee.

\(5\)

timestamp

Int

Transaction timestamp.

\(6\)

version

Int

Transaction version.

\(7\)

sender

Address

address of the transaction sender.

\(8\)

senderPublicKey

ByteVector

Public key of the transaction sender.

\(9\)

bodyBytes

ByteVector

Transaction body bytes.

\(10\)

proofs

List [ByteVector]

Proofs.

Genesis#

Genesis#

Transaction type ID

Name

Description

\(1\)

GenesisTransaction

Structure of genesis transaction.

GenesisTransaction#

Structure of a genesis transaction.

Constructor

GenesisTransaction(amount: Int, recipient: Address|Alias, id: ByteVector, fee: Int, timestamp: Int, version: Int)

Fields

GenesisTransaction Fields#

#

Name

Data type

Description

\(1\)

amount

Int

Amount of the token.

\(2\)

recipient

Address | Alias

address or alias of the token recipient.

\(3\)

id

ByteVector

Transaction ID.

\(4\)

fee

Int

Transaction fee.

\(5\)

timestamp

Int

Transaction timestamp.

\(6\)

version

Int

Transaction version.