Contracts
Deploy A Contract
Using contract deployment function a user can directly write smart contracts in Michelson language and deploy it on Tezos chain using this method, in return you'll get an operation group id of the deployed contract that can be use to track the contract on chain.
var server = '';
var contract = """parameter string;
storage string;
code { DUP;
DIP { CDR ; NIL string ; SWAP ; CONS } ;
CAR ; CONS ;
CONCAT;
NIL operation; PAIR}""";
var storage = '"Sample"';
var keyStore = KeyStoreModel(
publicKey: 'edpk.....rrj',
secretKey: 'edsk.....yHH',
publicKeyHash: 'tz1.....hxy',
);
var signer = await Dartez.createSigner(
Dartez.writeKeyWithHint(keyStore.secretKey, 'edsk'));
var result = await Dartez.sendContractOriginationOperation(
server,
signer,
keyStore,
0,
'',
100000,
1000,
100000,
contract,
storage,
codeFormat: TezosParameterFormat.Michelson,
);
print("Operation groupID ===> $result['operationGroupID']");
Check example.
Call A Contract
To invoke a deployed contract use this method, in return you'll get an operation group id of the invoked contract which can be used to track the contracts on chain.
Pre Apply Contract Invocation Operation
Before injecting an operation to the blockchain, the operation needs to be validated to check for any errors.
Inject Operation
This method inject the operation on to the blockchain and returns the operation group id which can be used to track the operation status on chain.
Get Operation Status
Get's the current status of an operation on the blockchain.
Sign Payload
This function is sued for signing a byte formatted payload and returns base58 signature signed payload using account secret key.
Get Block
This function will return the current block of tezos blockchain.
Get Contract Storage
This function is used for reading a contract storage and returns the micheline json storage.
Last updated