mirror of
https://github.com/FlipsideCrypto/near-bos-vm.git
synced 2026-02-06 11:18:24 +00:00
feat: inject other near
This commit is contained in:
parent
34a23dacf0
commit
50df4e2edc
@ -4,5 +4,5 @@ import { useMainnetNear } from "../data/near";
|
||||
|
||||
export const MainnetWidget = (props) => {
|
||||
const near = useMainnetNear();
|
||||
return <Widget {...props} near={near} />
|
||||
return <Widget {...props} otherEnvNear={near} />
|
||||
}
|
||||
@ -72,9 +72,7 @@ export const Widget = React.forwardRef((props, forwardedRef) => {
|
||||
const ethersProviderContext = useContext(EthersProviderContext);
|
||||
|
||||
const cache = useCache();
|
||||
const propsNear = props.near
|
||||
const singletonNear = useNear();
|
||||
const near = propsNear || singletonNear;
|
||||
const near = useNear();
|
||||
const accountId = useAccountId();
|
||||
const [element, setElement] = useState(null);
|
||||
|
||||
@ -170,7 +168,7 @@ export const Widget = React.forwardRef((props, forwardedRef) => {
|
||||
}
|
||||
setState(undefined);
|
||||
const vm = new VM({
|
||||
near,
|
||||
near: props.otherEnvNear || near,
|
||||
rawCode: code,
|
||||
setReactState: setState,
|
||||
cache,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user