|
|
@ -116,14 +116,15 @@ class MultiParamManager { |
|
|
|
title = this.funABI.type === 'receive' ? '(receive)' : '(fallback)' |
|
|
|
title = this.funABI.type === 'receive' ? '(receive)' : '(fallback)' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.basicInputField = yo`<input class="form-control" data-shared="multiParamManagerBasicInputField"></input>` |
|
|
|
this.basicInputField = yo`<input class="form-control"></input>` |
|
|
|
this.basicInputField.setAttribute('placeholder', this.inputs) |
|
|
|
this.basicInputField.setAttribute('placeholder', this.inputs) |
|
|
|
this.basicInputField.setAttribute('title', this.inputs) |
|
|
|
this.basicInputField.setAttribute('title', this.inputs) |
|
|
|
|
|
|
|
this.basicInputField.setAttribute('data-id', this.inputs) |
|
|
|
|
|
|
|
|
|
|
|
var onClick = () => { |
|
|
|
var onClick = () => { |
|
|
|
this.clickCallBack(this.funABI.inputs, this.basicInputField.value) |
|
|
|
this.clickCallBack(this.funABI.inputs, this.basicInputField.value) |
|
|
|
} |
|
|
|
} |
|
|
|
let funcButton = yo`<button onclick=${() => onClick()} data-shared="multiParamManagerFuncButton" class="${css.instanceButton} btn btn-sm">${title}</button>` |
|
|
|
let funcButton = yo`<button onclick=${() => onClick()} class="${css.instanceButton} btn btn-sm">${title}</button>` |
|
|
|
this.contractActionsContainerSingle = yo` |
|
|
|
this.contractActionsContainerSingle = yo` |
|
|
|
<div class="${css.contractActionsContainerSingle} pt-2"> |
|
|
|
<div class="${css.contractActionsContainerSingle} pt-2"> |
|
|
|
${funcButton} |
|
|
|
${funcButton} |
|
|
@ -142,7 +143,7 @@ class MultiParamManager { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var expandedButton = yo`<button onclick=${() => { multiOnClick() }} class="${css.instanceButton}" data-shared="multiParamManagerExpandedButton"></button>` |
|
|
|
var expandedButton = yo`<button onclick=${() => { multiOnClick() }} class="${css.instanceButton}"></button>` |
|
|
|
|
|
|
|
|
|
|
|
this.contractActionsContainerMulti = yo`<div class="${css.contractActionsContainerMulti}" >
|
|
|
|
this.contractActionsContainerMulti = yo`<div class="${css.contractActionsContainerMulti}" >
|
|
|
|
<div class="${css.contractActionsContainerMultiInner} text-dark" > |
|
|
|
<div class="${css.contractActionsContainerMultiInner} text-dark" > |
|
|
@ -185,6 +186,7 @@ class MultiParamManager { |
|
|
|
expandedButton.classList.add('btn-info') |
|
|
|
expandedButton.classList.add('btn-info') |
|
|
|
funcButton.setAttribute('title', (title + ' - call')) |
|
|
|
funcButton.setAttribute('title', (title + ' - call')) |
|
|
|
funcButton.classList.add('btn-info') |
|
|
|
funcButton.classList.add('btn-info') |
|
|
|
|
|
|
|
funcButton.setAttribute('data-id', (title + ' - call')) |
|
|
|
} else if (this.funABI.stateMutability === 'payable' || this.funABI.payable) { |
|
|
|
} else if (this.funABI.stateMutability === 'payable' || this.funABI.payable) { |
|
|
|
// transact. stateMutability = payable
|
|
|
|
// transact. stateMutability = payable
|
|
|
|
expandedButton.setAttribute('title', (title + ' - transact (payable)')) |
|
|
|
expandedButton.setAttribute('title', (title + ' - transact (payable)')) |
|
|
@ -192,6 +194,7 @@ class MultiParamManager { |
|
|
|
expandedButton.classList.add('btn-danger') |
|
|
|
expandedButton.classList.add('btn-danger') |
|
|
|
funcButton.setAttribute('title', (title + ' - transact (payable)')) |
|
|
|
funcButton.setAttribute('title', (title + ' - transact (payable)')) |
|
|
|
funcButton.classList.add('btn-danger') |
|
|
|
funcButton.classList.add('btn-danger') |
|
|
|
|
|
|
|
funcButton.setAttribute('data-id', (title + ' - transact (payable)')) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// transact. stateMutability = nonpayable
|
|
|
|
// transact. stateMutability = nonpayable
|
|
|
|
expandedButton.setAttribute('title', (title + ' - transact (not payable)')) |
|
|
|
expandedButton.setAttribute('title', (title + ' - transact (not payable)')) |
|
|
@ -199,6 +202,7 @@ class MultiParamManager { |
|
|
|
expandedButton.classList.add('btn-warning') |
|
|
|
expandedButton.classList.add('btn-warning') |
|
|
|
funcButton.classList.add('btn-warning') |
|
|
|
funcButton.classList.add('btn-warning') |
|
|
|
funcButton.setAttribute('title', (title + ' - transact (not payable)')) |
|
|
|
funcButton.setAttribute('title', (title + ' - transact (not payable)')) |
|
|
|
|
|
|
|
funcButton.setAttribute('data-id', (title + ' - transact (not payable)')) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.funABI.inputs && this.funABI.inputs.length > 0) { |
|
|
|
if (this.funABI.inputs && this.funABI.inputs.length > 0) { |
|
|
@ -207,6 +211,7 @@ class MultiParamManager { |
|
|
|
contractProperty.classList.add(css.hasArgs) |
|
|
|
contractProperty.classList.add(css.hasArgs) |
|
|
|
this.basicInputField.setAttribute('title', `'(${this.funABI.type}')`) // probably should pass name instead
|
|
|
|
this.basicInputField.setAttribute('title', `'(${this.funABI.type}')`) // probably should pass name instead
|
|
|
|
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden' |
|
|
|
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden' |
|
|
|
|
|
|
|
this.basicInputField.setAttribute('data-id', `'(${this.funABI.type}')`) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden' |
|
|
|
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden' |
|
|
|
this.basicInputField.style.visibility = 'hidden' |
|
|
|
this.basicInputField.style.visibility = 'hidden' |
|
|
|