Skip to content

Commit

Permalink
add vesting docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglescode committed Aug 19, 2024
1 parent 137d72c commit a8f25ff
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apps/playground/src/pages/smart-contracts/vesting/deposit-fund.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,25 @@ function Right() {
}

let code = ``;
code += `const assets: Asset[] = [\n`;
code += ` {\n`;
code += ` unit: "lovelace",\n`;
code += ` quantity: '${userInput}',\n`;
code += ` },\n`;
code += `];\n`;
code += `\n`;
code += `const lockUntilTimeStamp = new Date();\n`;
code += `lockUntilTimeStamp.setMinutes(lockUntilTimeStamp.getMinutes() + 1);\n`;
code += `\n`;
code += `const beneficiary = '${userInput2}';\n`;
code += `\n`;
code += `const tx = await contract.depositFund(\n`;
code += ` assets,\n`;
code += ` lockUntilTimeStamp.getTime(),\n`;
code += ` beneficiary,\n`;
code += `);\n`;
code += `const signedTx = await wallet.signTx(tx);\n`;
code += `const txHash = await wallet.submitTx(signedTx);\n`;

return (
<LiveCodeDemo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ function Right() {
}

let code = ``;
code += `const utxo = await contract.getUtxoByTxHash('${userInput}');\n\n`;
code += `const tx = await contract.withdrawFund(utxo);\n`;
code += `const signedTx = await wallet.signTx(tx, true);\n`;
code += `const txHash = await wallet.submitTx(signedTx);\n`;

return (
<LiveCodeDemo
Expand Down

0 comments on commit a8f25ff

Please sign in to comment.