Deploy class

Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake)

Constructors

Deploy(String hash, DeployHeader header, ExecutableDeployItem payment, ExecutableDeployItem session, List<DeployApproval> approvals)
Deploy.callAuctionContract(HashKey contractHash, String entryPoint, ClPublicKey from, ClPublicKey validator, BigInt amount, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Deploy.contract(Uint8List wasmBytes, ClPublicKey instigator, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to deploy a contract in the network. wasmBytes is the array of bytes of the contract compiled in Wasm. instigator is the public key of the account that deploys the contract. paymentAmount is the amount of CSPR (in motes) to pay for the deploy. chainName is the name of the network that will execute the deploy. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.contractCall(String contractName, String contractEntryPoint, List<NamedArg> args, ClPublicKey caller, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to call an entry point in a contract. The contract is referred by a named key in the caller's account. contractName is the named key in the caller account that contains a reference to the contract hash key. contractEntryPoint is the entry point of the contract to be called. args is the list of runtime arguments to be passed to the entry point. caller is the public key of the account that calls the contract. paymentAmount is the amount of CSPR (in motes) to pay for the call. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.contractCallByContractHash(HashKey contractHash, String contractEntryPoint, List<NamedArg> args, ClPublicKey caller, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to call an entry point in a contract. The contract is referred by a named key in the caller's account. contractHash is the contract hash key. contractEntryPoint is the entry point of the contract to be called. args is the list of runtime arguments to be passed to the entry point. caller is the public key of the account that calls the contract. paymentAmount is the amount of CSPR (in motes) to pay for the call. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.create(DeployHeader header, ExecutableDeployItem payment, ExecutableDeployItem session)
Deploy.delegateTokens(Uint8List delegateContractWasm, ClPublicKey from, ClPublicKey validator, BigInt amount, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to delegate tokens to a validator for staking. delegateContractWasm is the array of bytes containing the delegation contract (compiled in Wasm). from is the public key of the account that delegates the tokens. validator is the public key of the validator to which the tokens are delegated for staking. amount is the amount of CSPR (in motes) to delegate. paymentAmount is the amount of CSPR (in motes) to pay for the delegation deployment. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.delegateTokensByContractHash(HashKey contractHash, ClPublicKey from, ClPublicKey validator, BigInt amount, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to call the auction contract to delegate tokens to a validator for staking. Make sure you use the correct contract hash for the network you're sending. contractHash is the hash of the delegation contract in the network. from is the public key of the account that delegates the tokens. validator is the public key of the validator to which the tokens are delegated for staking. amount is the amount of CSPR (in motes) to delegate. paymentAmount is the amount of CSPR (in motes) to pay for the delegation deployment. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.fromJson(Map<String, dynamic> json)
factory
Deploy.standardTransfer(ClPublicKey from, ClPublicKey to, BigInt amount, BigInt paymentAmount, String chainName, [int? idTransfer, int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to make a transfer of CSPR between two accounts. from is the source account key. to is the target account key. amount is the amount of CSPR (in motes) to transfer. paymentAmount is the amount of CSPR (in motes) to pay for the transfer. chainName is the name of the network that will execute the transfer. idTransfer is the id of the transfer. Can be null if not needed. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.undelegateTokens(Uint8List undelegateContractWasm, ClPublicKey from, ClPublicKey validator, BigInt amount, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to undelegate tokens from a validator. undelegateContractWasm is the array of bytes containing the "undelegation" contract (compiled in Wasm). from is the public key of the account that undelegates the tokens. validator is the public key of the validator from which the tokens are undelegated. amount is the amount of CSPR (in motes) to undelegate. paymentAmount is the amount of CSPR (in motes) to pay for the delegation deployment. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.undelegateTokensByContractHash(HashKey contractHash, ClPublicKey from, ClPublicKey validator, BigInt amount, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to call the auction contract to delegate tokens to a validator for staking. Make sure you use the correct contract hash for the network you're sending. contractHash is the hash of the delegation contract in the network. from is the public key of the account that delegates the tokens. validator is the public key of the validator to which the tokens are delegated for staking. amount is the amount of CSPR (in motes) to delegate. paymentAmount is the amount of CSPR (in motes) to pay for the delegation deployment. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.versionedContractCall(String contractName, int? version, String contractEntryPoint, List<NamedArg> args, ClPublicKey caller, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to call an entry point in a versioned contract. The contract is referred by a named key in the caller's account. contractName is the named key in the caller account that contains a reference to the contract package key. version is the version of the contract to be called. contractEntryPoint is the entry point of the contract to be called. args is the list of runtime arguments to be passed to the entry point. caller is the public key of the account that calls the contract. paymentAmount is the amount of CSPR (in motes) to pay for the call. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.
Deploy.versionedContractCallByContractHash(HashKey contractHash, int? version, String contractEntryPoint, List<NamedArg> args, ClPublicKey caller, BigInt paymentAmount, String chainName, [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)])
Creates a Deploy object to call an entry point in a versioned contract. The contract is referred by the contract package hash key. contractHash is the contract package hash key. version is the version of the contract to be called. contractEntryPoint is the entry point of the contract to be called. args is the list of runtime arguments to be passed to the entry point. caller is the public key of the account that calls the contract. paymentAmount is the amount of CSPR (in motes) to pay for the call. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.

Properties

approvals List<DeployApproval>
getter/setter pair
bodyHash Uint8List
no setter
hash String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
getter/setter pair
headerHash Uint8List
no setter
payment ExecutableDeployItem
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
session ExecutableDeployItem
getter/setter pair

Methods

addApproval(DeployApproval approval) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign(KeyPair pair) Future<Uint8List>
toBytes() Uint8List
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited
verifySignatures() Future<ClPublicKey?>
Verifies the approval signatures of the deploy Returns null if the signature is valid, otherwise returns the public key of the signer that failed to verify

Operators

operator ==(Object other) bool
The equality operator.
inherited