Examples
Example 1: Transfer Tokens
ScriptBuilder sb = new ScriptBuilder();
sb.AllowGas(fromAddress, toAddress, gasPrice, gasLimit);
sb.TransferTokens("KCAL", fromAddress, toAddress, transferAmount);
sb.SpendGas(fromAddress);
byte[] script = sb.EndScript();Example 2: Transfer NFT
ScriptBuilder sb = new ScriptBuilder();
sb.AllowGas(fromAddress, toAddress, gasPrice, gasLimit);
sb.TransferNFT("NFT", fromAddress, toAddress, tokenId);
sb.SpendGas(fromAddress);
byte[] script = sb.EndScript();Example 3: Call Smart Contract
ScriptBuilder sb = new ScriptBuilder();
sb.AllowGas(fromAddress, toAddress, gasPrice, gasLimit);
sb.CallContract("MyContract", "MyMethod", arg1, arg2, arg3);
sb.SpendGas(fromAddress);
byte[] script = sb.EndScript();Example 4: Call NFT Contract
Last updated