Interface PublishContractArgs

The argument object for ContractApi.publishContract

{string} The amount in planck needed to execute the contract

{string} The compiled program in hex form (recommend to use [BlockTalk](https://github.com/burst-apps-team/blocktalk smart contracts compiler)

{number} Optional deadline in minutes, default is 1440

{string} The description of your contract (max. 1000 chars)

{string} The name for the contract

{string} is optional here, as it may be calculated dynamically for contracts. For automatic calculation pass an empty string

{string} is optional here, the initial data for the contract (must be according to your data stack in your contract and in BE hex code)

{number} is optional here, the number of pages to store contracts data. If not given, it's set to 1 or calculated from the eventually passed initial data. You can roughly say that if each data page holds 32 variables, i.e. the number of data pages is (variableCount/32) + 1

Consider publishing by reference also, which is way cheaper: ContractApi.publishContractByReference

interface PublishContractArgs {
    activationAmountPlanck: string;
    attachment?: Attachment;
    codeHex: string;
    data?: ContractData[];
    dataPages?: number;
    deadline?: number;
    description: string;
    feePlanck: string;
    name: string;
    referencedTransactionFullHash?: string;
    senderPrivateKey?: string;
    senderPublicKey: string;
    skipAdditionalSecurityCheck?: boolean;
}

Hierarchy

  • DefaultSendArgs
    • PublishContractArgs

Properties

activationAmountPlanck: string
attachment?: Attachment

An optional attachment

codeHex: string
data?: ContractData[]
dataPages?: number
deadline?: number

The deadline when after how many minutes the transaction will be discarded, if it was not processed, e.g. due to very low fee

description: string
feePlanck: string

The fee expressed in Planck

It's recommended to use util.Amount

name: string
referencedTransactionFullHash?: string

Using this field allows to make a transaction dependent on other transactions.

senderPrivateKey?: string

The senders private key, i.e. the crypto.SignKeys.signPrivateKey If the private key is not given, then the transaction method will return the unsigned byte string. The transaction won't be processed until the unsigned bytes are being signed and broadcasted using TransactionApi.signAndBroadcastTransaction

senderPublicKey: string

The senders public key, i.e. the crypto.SignKeys.publicKey

skipAdditionalSecurityCheck?: boolean

Setting this option to true, skips the additional security check, i.e. the verification of the unsigned transaction bytes, which detects tampered node responses. By default, the option is false. Usually, you won't use this option, but can be useful when a method cannot be verified, because the verification is not implemented yet.