+ ${userChoices.map(choice => html`
+
+ `)}
+
+ `: ''}
+ ${contractSubType === 'tokenswap' ? html`
+
-
- Contract name
-
-
- ${type === 'one-time-event' ? html`
-
- Asset
-
- ${render.availableAssetOptions()}
-
-
- ${subtype === 'time-trigger' ? html`
-
-
Payee FLO addresses
-
-
-
- ` : html`
-
-
Participant choices
-
-
-
+ ${!type && !subtype ? html`
+
+
+
+
+ ` : ''}
+
+
+ Contract name
+
+
+ ${type === 'one-time-event' ? html`
+
+ Asset
+
+ ${render.availableAssetOptions()}
+
+
+ ${subtype === 'time-trigger' ? html`
+
+
Payee FLO addresses
+
+
+
+ ` : html`
+
+
Participant choices
+
+
+
+
+
+
+ `}
+
+ Expiration
+
+
+
+ Participation amount (optional)
+
+
+
+ Min. subscription amount (optional)
+
+
+
+ Max. subscription amount (optional)
+
+
+ ` : html`
+
+
+ Deposit token
+
+ ${render.availableAssetOptions()}
+
+
+
+ Participation token
+
+ ${render.availableAssetOptions()}
+
+
+
+ Price (1 deposit token = ? participation token)
+
+
+ `}
+
+
FLO private key
+
+
+
+
+
+
+
-
-
- `}
-
- Expiration
-
-
-
- Participation amount (optional)
-
-
-
- Min. subscription amount (optional)
-
-
-
- Max. subscription amount (optional)
-
-
- ` : html`
-
-
- Deposit token
-
- ${render.availableAssetOptions()}
-
-
-
- Participation token
-
- ${render.availableAssetOptions()}
-
-
-
- Price (1 deposit token = ? participation token)
-
-
- `}
-
-
FLO private key
-
-
-
-
-
-
-
-
- `
+ `
}
}
let transactionsLazyLoader
@@ -2223,15 +2223,15 @@
card = createElement('div', {
className: 'generated-id-card',
innerHTML: `
-
-
FLO Address
-
-
-
-
Private Key
-
-
- `
+
+
FLO Address
+
+
+
+
Private Key
+
+
+ `
});
getRef('created_flo_id').innerHTML = '';
getRef('created_flo_id').append(card);
@@ -2338,30 +2338,30 @@
let ownedTokens = []
for (const token in floAddressBalances) {
ownedTokens.push(html`
-
- `)
+
+ `)
}
if (ownedTokens.length) {
ownedTokens.push(html`
-
- `)
+
+ `)
renderElem(document.getElementById('sender_tokens_wrapper'), html.for(document.getElementById('sender_tokens_wrapper'), senderFloAddr)`
-
-
Tokens
-
Select a token, if you want to send a token.
-
-
- `)
+
+
Tokens
+
Select a token, if you want to send a token.
+
+
+ `)
document.getElementById('sender_tokens_wrapper').classList.remove('hidden')
handleTokenSelection()
} else {
@@ -2381,12 +2381,12 @@
getRef('tx_flo_amount').classList.remove('hidden')
renderElem(getRef('tx_receiver_wrapper'), html``)
renderElem(getRef('tx_receiver_wrapper'), html`
-
-
-
- `)
+
+
+
+ `)
getRef('add_token_receiver').classList.add('hidden')
floGlobals.sendType = 'flo'
getRef('send_form').elementsChanged()
@@ -2410,22 +2410,22 @@
const tokenName = selectedToken.value;
const isFirst = getRef('tx_receiver_wrapper').children.length === 0
getRef('tx_receiver_wrapper').append(html.node`
-
-
-
-
-
-
- ${!isFirst ? html.node`
-
- ` : ''}
-
- `)
+
+
+
+
+
+
+ ${!isFirst ? html.node`
+
+ ` : ''}
+
+ `)
getRef('send_form').elementsChanged()
}
function removeTokenReceiver(elem) {
@@ -2445,40 +2445,40 @@
console.log(options)
getRef('tx_flo_amount').setAttribute('max', balance)
renderElem(getRef('balance_card'), html`
-
-
-
Balance
-
-
-
- ${showLoader ? html`` : balance}
- FLO
-
-
- Sender FLO Address
-
${address}
-
- ${!showLoader && balance == 0 ? html`
-
- You don't have any FLO in your wallet. Please add some FLO to your wallet to send FLO.
-
- ` : ''}
-
-
- `)
+
+
+
Balance
+
+
+
+ ${showLoader ? html`` : balance}
+ FLO
+
+
+ Sender FLO Address
+
${address}
+
+ ${!showLoader && balance == 0 ? html`
+
+ You don't have any FLO in your wallet. Please add some FLO to your wallet to send FLO.
+
+ ` : ''}
+
+
+ `)
}
function resetBalance() {
clearSelection()
renderElem(getRef('balance_card'), html`
-
-
Balance
-
-
- Sender balance will be shown once you enter it's private key
-
- `)
+
+
Balance
+
+
+ Sender balance will be shown once you enter it's private key
+
+ `)
}
@@ -2539,9 +2539,9 @@
getRef('queried_flo_address').innerHTML = `
${allLabels[queriedFloId]}
`;
} else {
getRef('queried_flo_address').innerHTML = `
-
FLO Address
-
- `;
+
FLO Address
+
+ `;
}
})
const queriedFloId = address || getRef('search_query_input').value.trim()
@@ -2554,10 +2554,10 @@
let ownedTokens = []
for (const token in tokenBalances) {
ownedTokens.push(html`
-
- ${token}: ${parseFloat((tokenBalances[token].balance || 0).toFixed(8))}
-
- `)
+
+ ${token}: ${parseFloat((tokenBalances[token].balance || 0).toFixed(8))}
+
+ `)
}
if (ownedTokens.length) {
renderElem(getRef('token_list'), html`${ownedTokens}`)
@@ -2597,11 +2597,11 @@
document.getElementById('load_more_transactions').classList.add('hidden')
renderElem(getRef('pagination_wrapper'), html``)
renderElem(getRef('queried_address_transactions'), html`
-
-
- Loading transactions...
-
- `)
+
+
+ Loading transactions...
+
+ `)
const { items, totalPages } = await floWebWallet.listTransactions(address, { pageSize: txsPerPage, page })
floGlobals.query = {
transactions: items,
@@ -2685,8 +2685,8 @@
if (tokenReceivers.length) {
const consent = await getConfirmation(`Confirm transaction`, {
message: `
- Sending ${selectedToken.value} tokens to \n\n ${tokenReceivers.map(r => `${r}: ${bulkTokenReceivers[r]} ${selectedToken.value}`).join('\n')}
- `,
+ Sending ${selectedToken.value} tokens to \n\n ${tokenReceivers.map(r => `${r}: ${bulkTokenReceivers[r]} ${selectedToken.value}`).join('\n')}
+ `,
confirmText: 'Send',
})
if (!consent) return;
@@ -2697,16 +2697,16 @@
showTransactionResult(true, null, {
title: `Multiple transactions have been initiated`,
description: html`
-
- `
+
+ `
});
} else {
const floData = `send ${bulkTokenReceivers[tokenReceivers[0]]} ${selectedToken.value}#`
@@ -2738,24 +2738,24 @@
description = success ? 'This might take upto 30 mins to complete and reflect on blockchain.' : result
renderElem(getRef('transaction_result'), html`
- ${success ? html`
-
- ` : ''}
- ${!success ? html`
-
- ` : ''}
-
${title}
-
${description}
- ${success && result ? html`
-
- ` : ''}
- `)
+ ${success ? html`
+
+ ` : ''}
+ ${!success ? html`
+
+ ` : ''}
+
${title}
+
${description}
+ ${success && result ? html`
+
+ ` : ''}
+ `)
openPopup('transaction_result_popup')
}
@@ -3042,6 +3042,7 @@
const [contractName, contractAddress] = (selectedSmartContract).split('_')
const oraclePrivateKey = document.getElementById('oracle_private_key').value.trim()
const oracleAddress = document.getElementById('oracle_address').value
+ const { acceptingToken } = getScDetails(contractName, contractAddress)
if (!floCrypto.verifyPrivKey(oraclePrivateKey, oracleAddress)) {
return notify(`Private key doesn't match with Oracle address`, 'error')
}
@@ -3049,7 +3050,7 @@
const floData = ` {"price-update":{"contract-name": "${contractName}", "contract-address": "${contractAddress}", "price": ${updatedPrice}}} `
console.log(floData)
getConfirmation('Update price', {
- message: `Are you sure you want to update the price of ${contractName} to ${updatedPrice} FLO?`,
+ message: `Are you sure you want to update the price of ${contractName} to ${updatedPrice} ${acceptingToken}?`,
confirmText: 'Update',
cancelText: 'Cancel'
}).then((res) => {
@@ -3111,11 +3112,11 @@
case 'dynamic':
e.target.closest('sm-form').querySelector('.oracle-address-wrapper')?.remove()
e.target.closest('fieldset').after(html.node`
-
- Oracle FLO address
-
-
- `)
+
+ Oracle FLO address
+
+
+ `)
break;
}
}
@@ -3241,7 +3242,7 @@
showTransactionResult(true, txid, {
title: 'Smart contract creation initiated',
description: html`Check details about your smart contract
here.
-
It may take some time for the smart contract to be created.`
+
It may take some time for the smart contract to be created.`
})
getRef('smart_contract_creation_form').reset()
document.getElementById('create_contract_button').disabled = true
@@ -3256,14 +3257,14 @@
function addPayeeAddress() {
document.getElementById('payee_container').append(html.node`
-
-
-
-
-
- `)
+
+
+
+
+
+ `)
document.getElementById('payee_container').querySelectorAll('.payee-share').forEach((input) => {
input.value = parseFloat((100 / document.getElementById('payee_container').querySelectorAll('.payee-share').length).toFixed(2))
})
@@ -3284,13 +3285,13 @@
function addChoice(e) {
const choiceNo = document.getElementById('choices_container').children.length + 1
document.getElementById('choices_container').append(html.node`
-
-
-
-
- `)
+
+
+
+
+ `)
}
function removeChoice(e) {
e.target.closest('.choice-wrapper').remove()
@@ -3316,7 +3317,6 @@
function replaceDash(str) {
return str.replace(/-/g, ' ')
}
-