Skip to content

Latest commit

 

History

History
132 lines (121 loc) · 23.8 KB

File metadata and controls

132 lines (121 loc) · 23.8 KB

Standard Library

Types

type adds
Unit Native
Int Native
Boolean Native
ByteVector Native
String Native
Address
  • bytes ByteVector
Alias
  • alias String
Transfer
  • recipient Address Alias
  • amount Int
Order
  • id ByteVector
  • matcherPublicKey ByteVector
  • assetPair AssetPair
  • orderType Buy Sell
  • price Int
  • amount Int
  • timestamp Int
  • expiration Int
  • matcherFee Int
  • sender Address
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
AssetPair
  • amountAsset OPTION(ByteVector)
  • priceAsset OPTION(ByteVector)
DataEntry
  • key String
  • value Int Boolean ByteVector String
Transaction TransferTransaction IssueTransaction ReissueTransaction BurnTransaction LeaseTransaction LeaseCancelTransaction MassTransferTransaction CreateAliasTransaction SetScriptTransaction SponsorFeeTransaction ExchangeTransaction DataTransaction
GenesisTransaction
  • amount Int
  • recipientAddress Alias
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
PaymentTransaction
  • amount Int
  • recipientAddress Alias
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
TransferTransaction
  • feeAssetId OPTION(ByteVector)
  • amount Int
  • assetId OPTION(ByteVector)
  • recipientAddress Alias
  • attachment ByteVector
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
IssueTransaction
  • quantity Int
  • name ByteVector
  • description ByteVector
  • reissuable Boolean
  • decimals Int
  • script OPTION(ByteVector)
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
ReissueTransaction
  • quantity Int
  • assetId ByteVector
  • reissuable Boolean
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
BurnTransaction
  • quantity Int
  • assetId ByteVector
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
LeaseTransaction
  • amount Int
  • recipientAddress Alias
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
LeaseCancelTransaction
  • leaseId ByteVector
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
MassTransferTransaction
  • feeAssetId OPTION(ByteVector)
  • assetId OPTION(ByteVector)
  • totalAmount Int
  • transfers LIST[ Transfer]
  • transferCount Int
  • attachment ByteVector
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
CreateAliasTransaction
  • alias String
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
SetScriptTransaction
  • script OPTION(ByteVector)
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
SponsorFeeTransaction
  • assetId ByteVector
  • minSponsoredAssetFee OPTION(Int)
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
ExchangeTransaction
  • buyOrderOrder
  • sellOrderOrder
  • price Int
  • amount Int
  • buyMatcherFee Int
  • sellMatcherFee Int
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector
DataTransaction
  • data LIST[ DataEntry]
  • id ByteVector
  • fee Int
  • timestamp Int
  • version Int
  • senderAddress
  • senderPublicKey ByteVector
  • bodyBytes ByteVector
  • proofs LIST ByteVector

Input variables

vars type doc
unit Unit Single instance value
height Int Current blockchain height
tx Order TransferTransaction IssueTransaction ReissueTransaction BurnTransaction LeaseTransaction LeaseCancelTransaction MassTransferTransaction CreateAliasTransaction SetScriptTransaction SponsorFeeTransaction ExchangeTransaction DataTransaction Processing transaction

Functions

funcs cost doc params type
fraction 1 Multiply and dividion with big integer intermediate representation
  • value Int multiplyer
  • numerator Int multiplyer
  • denominator Int divisor
Int
size 1 Size of bytes vector
  • byteVector ByteVector vector
Int
toBytes 1 Bytes array representation
  • b Boolean value
ByteVector
toBytes 1 Bytes array representation
  • n Int value
ByteVector
toBytes 1 Bytes array representation
  • s String value
ByteVector
take 1 Take firsts bytes subvector
  • xs ByteVector vector
  • number Int Bytes number
ByteVector
drop 1 Skip firsts bytes
  • xs ByteVector vector
  • number Int Bytes number
ByteVector
takeRight Take vector tail
  • @xs ByteVector vector
  • @number Int taking size
ByteVector
dropRight Cut vectors tail
  • @xs ByteVector vector
  • @number Int cuting size
ByteVector
size 1 Scting size in characters
  • xs String string
Int
toString 1 String representation
  • b Boolean value
String
toString 1 String representation
  • n Int value
String
take 1 Take string prefix
  • xs String sctring
  • number Int prefix size in characters
String
drop 1 Remmove sring prefix
  • xs String string
  • number Int prefix size
String
takeRight Take string suffix
  • @xs String String
  • @number Int suffix size in characters
String
dropRight Remove string suffix
  • @xs String string
  • @number Int suffix size in characters
String
_isInstanceOf 1 Internal function to check value type
  • obj T value
  • of String type name
Boolean
isDefined Check the value is defined
  • @a OPTION[ T] Option value
Boolean
extract Extract value from option or fail
  • @a OPTION[ T] Optional value
T
throw 1 Fail script
  • err String Error message
Nothing
throw Fail script
    Nothing
    * 1 Integer multiplication
    • a Int multiplyer
    • b Int multiplyer
    Int
    / 1 Integer devision
    • a Int divisible
    • b Int divisor
    Int
    % 1 Modulo
    • a Int divisible
    • b Int divisor
    Int
    + 1 Integer sum
    • a Int term
    • b Int term
    Int
    - 1 Integer substitution
    • a Int term
    • b Int term
    Int
    + 10 Limited strings concatination
    • a String prefix
    • b String suffix
    String
    + 10 Limited bytes vectors concatination
    • a ByteVector prefix
    • b ByteVector suffix
    ByteVector
    == 1 Equality
    • a T value
    • b T value
    Boolean
    != Inequality
    • @a T value
    • @b T value
    Boolean
    >= 1 Integer grater or equal comparation
    • a Int term
    • b Int term
    Boolean
    > 1 Integer grater comparation
    • a Int term
    • b Int term
    Boolean
    getElement 2 Get list element by position
    • arr LIST[ T] list
    • pos Int element position
    T
    size 2 Size of list
    • arr LIST[ T] list
    Int
    - Change integer sign
    • @n Int value
    Int
    ! unary negation
    • @p Boolean boolean
    Boolean
    keccak256 10 256 bit Keccak/SHA-3/TIPS-202
    • bytes ByteVector value
    ByteVector
    blake2b256 10 256 bit BLAKE
    • bytes ByteVector value
    ByteVector
    sha256 10 256 bit SHA-2
    • bytes ByteVector value
    ByteVector
    sigVerify 100 check signature
    • message ByteVector value
    • sig ByteVector signature
    • pub ByteVector public key
    Boolean
    toBase58String 10 Base58 encode
    • bytes ByteVector value
    String
    fromBase58String 10 Base58 decode
    • str String base58 encoded string
    ByteVector
    toBase64String 10 Base64 encode
    • bytes ByteVector value
    String
    fromBase64String 10 Base64 decode
    • str String base64 encoded string
    ByteVector
    transactionById 100 Lookup transaction
    • id ByteVector transaction Id
    Unit GenesisTransaction PaymentTransaction TransferTransaction IssueTransaction ReissueTransaction BurnTransaction LeaseTransaction LeaseCancelTransaction MassTransferTransaction CreateAliasTransaction SetScriptTransaction SponsorFeeTransaction ExchangeTransaction DataTransaction
    transactionHeightById 100 get height when transaction was stored to blockchain
    • id ByteVector transaction Id
    OPTION[ Int]
    getInteger 100 get data from the account state
    • addressOrAlias Address Alias account
    • key String key
    OPTION[ Int]
    getBoolean 100 get data from the account state
    • addressOrAlias Address Alias account
    • key String key
    OPTION[ Boolean]
    getBinary 100 get data from the account state
    • addressOrAlias Address Alias account
    • key String key
    OPTION ByteVector
    getString 100 get data from the account state
    • addressOrAlias Address Alias account
    • key String key
    OPTION[ String]
    getInteger 10 Find and extract data by key
    • data LIST[ DataEntry] DataEntry vector, usally tx.data
    • key String key
    OPTION[ Int]
    getBoolean 10 Find and extract data by key
    • data LIST[ DataEntry] DataEntry vector, usally tx.data
    • key String key
    OPTION[ Boolean]
    getBinary 10 Find and extract data by key
    • data LIST[ DataEntry] DataEntry vector, usally tx.data
    • key String key
    OPTION ByteVector
    getString 10 Find and extract data by key
    • data LIST[ DataEntry] DataEntry vector, usally tx.data
    • key String key
    OPTION[ String]
    getInteger Extract data by index
    • @data LIST[ DataEntry] DataEntry vector, usally tx.data
    • @index Int index
    OPTION[ Int]
    getBoolean Extract data by index
    • @data LIST[ DataEntry] DataEntry vector, usally tx.data
    • @index Int index
    OPTION[ Boolean]
    getBinary Extract data by index
    • @data LIST[ DataEntry] DataEntry vector, usally tx.data
    • @index Int index
    OPTION ByteVector
    getString Extract data by index
    • @data LIST[ DataEntry] DataEntry vector, usally tx.data
    • @index Int index
    OPTION[ String]
    addressFromPublicKey Convert public key to account address
    • @publicKey ByteVector public key
    Address
    addressFromString Decode account address
    • @string String string address represntation
    OPTION[ Address]
    addressFromRecipient 100 Extract address or lookup alias
    • AddressOrAlias Address Alias address or alias, usually tx.recipient
    Address
    assetBalance 100 get asset balance for account
    • addressOrAlias Address Alias account
    • assetId OPTION ByteVector assetId (WAVES if none)
    Int
    wavesBalance get WAVES balanse for account
    • @addressOrAlias Address Alias account
    Int

    Common fields

    tx type id fee timestamp version sender senderPublicKey bodyBytes proofs
    TransferTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    IssueTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    ReissueTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    BurnTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    LeaseTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    LeaseCancelTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    MassTransferTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    CreateAliasTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    SetScriptTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    SponsorFeeTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    ExchangeTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]
    DataTransaction ByteVector Int Int Int Address ByteVector ByteVector LIST[ByteVector]

    Transfers fields

    PaymentTransactionTransferTransactionMassTransferTransaction
    amount Int Int-
    recipient Address Alias Address Alias-
    feeAssetId- OPTION[ByteVector] OPTION[ByteVector]
    assetId- OPTION[ByteVector] OPTION[ByteVector]
    attachment- ByteVector ByteVector
    totalAmount-- Int
    transfers-- LIST[Transfer]
    transferCount-- Int

    Issuing assets fields

    IssueTransactionReissueTransactionBurnTransactionSponsorFeeTransaction
    quantity Int Int Int-
    name ByteVector---
    description ByteVector---
    reissuable Boolean Boolean--
    decimals Int---
    script OPTION[ByteVector]---
    assetId- ByteVector ByteVector ByteVector
    minSponsoredAssetFee--- OPTION[Int]

    Leasing fields

    LeaseTransactionLeaseCancelTransaction
    amount Int-
    recipient Address Alias-
    leaseId- ByteVector

    Other fields

    CreateAliasTransactionSetScriptTransactionExchangeTransactionDataTransaction
    alias String---
    script- OPTION[ByteVector]--
    buyOrder-- Order-
    sellOrder-- Order-
    price-- Int-
    amount-- Int-
    buyMatcherFee-- Int-
    sellMatcherFee-- Int-
    data--- LIST[DataEntry]