Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ <h4 class="card-title">
>
Approve Tokens Without Gas
</button>

<p class="info-text alert alert-secondary">
Token methods result: <span id="tokenMethodsResult"></span>
</p>
</div>
</div>
</div>
Expand Down
26 changes: 17 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ const approveTokensWithoutGas = document.getElementById(
'approveTokensWithoutGas',
);

const tokenMethodsResult = document.getElementById('tokenMethodsResult');

// Encrypt / Decrypt Section
const getEncryptionKeyButton = document.getElementById(
'getEncryptionKeyButton',
Expand Down Expand Up @@ -920,6 +922,7 @@ const clearDisplayElements = () => {
cleartextDisplay.innerText = '';
batchTransferTokenIds.value = '';
batchTransferTokenAmounts.value = '';
tokenMethodsResult.value = '';
};

const updateOnboardElements = () => {
Expand Down Expand Up @@ -1767,15 +1770,20 @@ const initializeFormElements = () => {
};

transferFromTokens.onclick = async () => {
const result = await hstContract.transferFrom(
transferFromSenderInput.value,
transferFromRecipientInput.value,
decimalUnitsInput.value === '0'
? 1
: `${1.5 * 10 ** decimalUnitsInput.value}`,
{ from: accounts[0] },
);
console.log('result', result);
try {
const result = await hstContract.transferFrom(
transferFromSenderInput.value,
transferFromRecipientInput.value,
decimalUnitsInput.value === '0'
? 1
: `${1.5 * 10 ** decimalUnitsInput.value}`,
{ from: accounts[0] },
);
console.log('result', result);
tokenMethodsResult.innerHTML = result;
} catch (error) {
tokenMethodsResult.innerHTML = error.message;

Check warning

Code scanning / CodeQL

Exception text reinterpreted as HTML

[Exception text](1) is reinterpreted as HTML without escaping meta-characters. [Exception text](2) is reinterpreted as HTML without escaping meta-characters.
}
};

transferTokensWithoutGas.onclick = async () => {
Expand Down