diff --git a/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx b/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx index 9383875477..7fcc0b4970 100644 --- a/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx @@ -94,6 +94,8 @@ export function InstanceContainerUI(props: InstanceContainerProps) { sendValue={props.sendValue} getFuncABIInputs={props.getFuncABIInputs} plugin={props.plugin} + exEnvironment={props.exEnvironment} + editInstance={props.editInstance} /> ) })} @@ -141,6 +143,8 @@ export function InstanceContainerUI(props: InstanceContainerProps) { sendValue={props.sendValue} getFuncABIInputs={props.getFuncABIInputs} plugin={props.plugin} + exEnvironment={props.exEnvironment} + editInstance={props.editInstance} /> ) })} diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 33503df919..166a64583c 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -294,10 +294,11 @@ export function UniversalDappUI(props: UdappProps) {
-
+
+ {props.exEnvironment === 'injected' && {props.editInstance(props.instance)}}>}
{ props.isSavedContract && props.instance.savedOn ? (
diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index 6b7ec78da0..c726e24d0d 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -324,6 +324,10 @@ export function RunTabUI(props: RunTabProps) { runTransactions={executeTransactions} sendValue={runTab.sendValue} getFuncABIInputs={getFuncABIValues} + exEnvironment={runTab.selectExEnv} + editInstance={(instance) => { + plugin.call('dapp-draft', 'edit', {address: instance.address, abi: instance.contractData.abi, name: instance.name, network: runTab.networkName}) + }} />
diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts index 412601765b..c8184d1890 100644 --- a/libs/remix-ui/run-tab/src/lib/types/index.ts +++ b/libs/remix-ui/run-tab/src/lib/types/index.ts @@ -342,6 +342,8 @@ export interface InstanceContainerProps { mainnetPrompt: (tx: Tx, network: Network, amount: string, gasEstimation: string, gasFees: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, determineGasPrice: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void) => JSX.Element, sendValue: string, getFuncABIInputs: (funcABI: FuncABI) => string + exEnvironment: string + editInstance: (instance) => void plugin: RunTab } @@ -449,6 +451,8 @@ export interface UdappProps { funcIndex?: number) => void, sendValue: string, getFuncABIInputs: (funcABI: FuncABI) => string + exEnvironment: string + editInstance: (instance) => void plugin: RunTab }