Compare commits
6 Commits
mobile-opt
...
feat/initi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
775ae3de9b | ||
|
|
6fa68b9d6b | ||
|
|
b7c48c81a4 | ||
|
|
33019835ea | ||
|
|
fbc9a038ef | ||
|
|
318633c5e1 |
@@ -6,14 +6,11 @@ const ButtonGroup = styled('div', {
|
|||||||
marginLeft: '1px',
|
marginLeft: '1px',
|
||||||
[`& ${StyledButton}`]: {
|
[`& ${StyledButton}`]: {
|
||||||
marginLeft: '-1px',
|
marginLeft: '-1px',
|
||||||
px: '0.65rem',
|
px: '$4',
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
'&:hover, &:focus': {
|
'&:hover, &:focus': {
|
||||||
zIndex: 200
|
zIndex: 200
|
||||||
},
|
|
||||||
'@sm': {
|
|
||||||
px: '$4'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[`& ${StyledButton}:not(:only-of-type):not(:first-child):not(:last-child)`]: {
|
[`& ${StyledButton}:not(:only-of-type):not(:first-child):not(:last-child)`]: {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { subscribeKey } from 'valtio/utils'
|
|||||||
import { Select } from '.'
|
import { Select } from '.'
|
||||||
import state, { ILog, transactionsState } from '../state'
|
import state, { ILog, transactionsState } from '../state'
|
||||||
import { extractJSON } from '../utils/json'
|
import { extractJSON } from '../utils/json'
|
||||||
import EnrichLog from './EnrichLog'
|
|
||||||
import LogBox from './LogBox'
|
import LogBox from './LogBox'
|
||||||
|
|
||||||
interface ISelect<T = string> {
|
interface ISelect<T = string> {
|
||||||
@@ -100,11 +99,6 @@ const addListeners = (account: ISelect | null) => {
|
|||||||
|
|
||||||
subscribeKey(streamState, 'selectedAccount', addListeners)
|
subscribeKey(streamState, 'selectedAccount', addListeners)
|
||||||
|
|
||||||
const clearLog = () => {
|
|
||||||
streamState.logs = []
|
|
||||||
streamState.statusChangeTimestamp = Date.now()
|
|
||||||
}
|
|
||||||
|
|
||||||
const DebugStream = () => {
|
const DebugStream = () => {
|
||||||
const { selectedAccount, logs } = useSnapshot(streamState)
|
const { selectedAccount, logs } = useSnapshot(streamState)
|
||||||
const { activeHeader: activeTxTab } = useSnapshot(transactionsState)
|
const { activeHeader: activeTxTab } = useSnapshot(transactionsState)
|
||||||
@@ -140,6 +134,11 @@ const DebugStream = () => {
|
|||||||
streamState.selectedAccount = account
|
streamState.selectedAccount = account
|
||||||
}, [activeTxTab])
|
}, [activeTxTab])
|
||||||
|
|
||||||
|
const clearLog = () => {
|
||||||
|
streamState.logs = []
|
||||||
|
streamState.statusChangeTimestamp = Date.now()
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LogBox enhanced renderNav={renderNav} title="Debug stream" logs={logs} clearLog={clearLog} />
|
<LogBox enhanced renderNav={renderNav} title="Debug stream" logs={logs} clearLog={clearLog} />
|
||||||
)
|
)
|
||||||
@@ -158,11 +157,9 @@ export const pushLog = (str: any, opts: Partial<Pick<ILog, 'type'>> = {}): ILog
|
|||||||
const timestring = !timestamp ? tm : new Date(timestamp).toLocaleTimeString()
|
const timestring = !timestamp ? tm : new Date(timestamp).toLocaleTimeString()
|
||||||
|
|
||||||
const extracted = extractJSON(msg)
|
const extracted = extractJSON(msg)
|
||||||
const _message = !extracted ? msg : msg.slice(0, extracted.start) + msg.slice(extracted.end + 1)
|
const message = !extracted ? msg : msg.slice(0, extracted.start) + msg.slice(extracted.end + 1)
|
||||||
const message = ref(<EnrichLog str={_message} />)
|
|
||||||
|
|
||||||
const _jsonData = extracted ? JSON.stringify(extracted.result, null, 2) : undefined
|
const jsonData = extracted ? JSON.stringify(extracted.result, null, 2) : undefined
|
||||||
const jsonData = _jsonData ? ref(<EnrichLog str={_jsonData} />) : undefined
|
|
||||||
|
|
||||||
if (extracted?.result?.id?._Request?.includes('hooks-builder-req')) {
|
if (extracted?.result?.id?._Request?.includes('hooks-builder-req')) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -40,10 +40,11 @@ const StyledContent = styled(DialogPrimitive.Content, {
|
|||||||
color: '$mauve12',
|
color: '$mauve12',
|
||||||
borderRadius: '$md',
|
borderRadius: '$md',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
mb: '0%',
|
mb: '15%',
|
||||||
boxShadow: '0px 10px 38px -5px rgba(22, 23, 24, 0.25), 0px 10px 20px -5px rgba(22, 23, 24, 0.2)',
|
boxShadow: '0px 10px 38px -5px rgba(22, 23, 24, 0.25), 0px 10px 20px -5px rgba(22, 23, 24, 0.2)',
|
||||||
width: '90vw',
|
width: '90vw',
|
||||||
maxWidth: '450px',
|
maxWidth: '450px',
|
||||||
|
// maxHeight: "85vh",
|
||||||
padding: 25,
|
padding: 25,
|
||||||
'@media (prefers-reduced-motion: no-preference)': {
|
'@media (prefers-reduced-motion: no-preference)': {
|
||||||
animation: `${contentShow} 150ms cubic-bezier(0.16, 1, 0.3, 1)`
|
animation: `${contentShow} 150ms cubic-bezier(0.16, 1, 0.3, 1)`
|
||||||
@@ -52,9 +53,6 @@ const StyledContent = styled(DialogPrimitive.Content, {
|
|||||||
'.dark &': {
|
'.dark &': {
|
||||||
backgroundColor: '$mauve5',
|
backgroundColor: '$mauve5',
|
||||||
boxShadow: '0px 10px 38px 0px rgba(0, 0, 0, 0.85), 0px 10px 20px 0px rgba(0, 0, 0, 0.6)'
|
boxShadow: '0px 10px 38px 0px rgba(0, 0, 0, 0.85), 0px 10px 20px 0px rgba(0, 0, 0, 0.6)'
|
||||||
},
|
|
||||||
'@md': {
|
|
||||||
mb: '8%'
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ const EditorNavigation = ({ renderNav }: { renderNav?: () => ReactNode }) => {
|
|||||||
return (
|
return (
|
||||||
<Flex css={{ flexShrink: 0, gap: '$0' }}>
|
<Flex css={{ flexShrink: 0, gap: '$0' }}>
|
||||||
<Flex
|
<Flex
|
||||||
|
id="kissa"
|
||||||
ref={scrollRef}
|
ref={scrollRef}
|
||||||
css={{
|
css={{
|
||||||
overflowX: 'scroll',
|
overflowX: 'scroll',
|
||||||
@@ -180,21 +181,7 @@ const EditorNavigation = ({ renderNav }: { renderNav?: () => ReactNode }) => {
|
|||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button outline size="sm" css={{ mr: '$3' }} onClick={() => setPopUp(true)}>
|
||||||
outline
|
|
||||||
size="sm"
|
|
||||||
css={{
|
|
||||||
mr: '-1px',
|
|
||||||
borderTopRightRadius: 0,
|
|
||||||
borderBottomRightRadius: 0,
|
|
||||||
'@sm': {
|
|
||||||
borderTopRightRadius: '$sm',
|
|
||||||
borderBottomRightRadius: '$sm',
|
|
||||||
mr: '$3'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onClick={() => setPopUp(true)}
|
|
||||||
>
|
|
||||||
<GithubLogo size="16px" /> Login
|
<GithubLogo size="16px" /> Login
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
@@ -215,9 +202,6 @@ const EditorNavigation = ({ renderNav }: { renderNav?: () => ReactNode }) => {
|
|||||||
alignSelf: 'flex-start',
|
alignSelf: 'flex-start',
|
||||||
boxShadow: 'none'
|
boxShadow: 'none'
|
||||||
},
|
},
|
||||||
'button:not(:last-child)': {
|
|
||||||
display: 'none'
|
|
||||||
},
|
|
||||||
'button:not(:first-child):not(:last-child)': {
|
'button:not(:first-child):not(:last-child)': {
|
||||||
borderRight: 0,
|
borderRight: 0,
|
||||||
borderLeft: 0
|
borderLeft: 0
|
||||||
@@ -233,11 +217,6 @@ const EditorNavigation = ({ renderNav }: { renderNav?: () => ReactNode }) => {
|
|||||||
'&:hover': {
|
'&:hover': {
|
||||||
boxShadow: 'inset 0px 0px 0px 1px $colors$mauve12'
|
boxShadow: 'inset 0px 0px 0px 1px $colors$mauve12'
|
||||||
}
|
}
|
||||||
},
|
|
||||||
'@sm': {
|
|
||||||
'button:not(:last-child)': {
|
|
||||||
display: 'flex'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
import { FC, useState } from 'react'
|
|
||||||
import regexifyString from 'regexify-string'
|
|
||||||
import { useSnapshot } from 'valtio'
|
|
||||||
import { Link } from '.'
|
|
||||||
import state from '../state'
|
|
||||||
import { AccountDialog } from './Accounts'
|
|
||||||
import Tooltip from './Tooltip'
|
|
||||||
import hookSetCodes from '../content/hook-set-codes.json'
|
|
||||||
import { capitalize } from '../utils/helpers'
|
|
||||||
|
|
||||||
interface EnrichLogProps {
|
|
||||||
str?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const EnrichLog: FC<EnrichLogProps> = ({ str }) => {
|
|
||||||
const { accounts } = useSnapshot(state)
|
|
||||||
const [dialogAccount, setDialogAccount] = useState<string | null>(null)
|
|
||||||
if (!str || !accounts.length) return <>{str}</>
|
|
||||||
|
|
||||||
const addrs = accounts.map(acc => acc.address)
|
|
||||||
const regex = `(${addrs.join('|')}|HookSet\\(\\d+\\))`
|
|
||||||
const res = regexifyString({
|
|
||||||
pattern: new RegExp(regex, 'gim'),
|
|
||||||
decorator: (match, idx) => {
|
|
||||||
if (match.startsWith('r')) {
|
|
||||||
// Account
|
|
||||||
const name = accounts.find(acc => acc.address === match)?.name
|
|
||||||
return (
|
|
||||||
<Link
|
|
||||||
key={match + idx}
|
|
||||||
as="a"
|
|
||||||
onClick={() => setDialogAccount(match)}
|
|
||||||
title={match}
|
|
||||||
highlighted
|
|
||||||
>
|
|
||||||
{name || match}
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (match.startsWith('HookSet')) {
|
|
||||||
const code = match.match(/^HookSet\((\d+)\)/)?.[1]
|
|
||||||
const val = hookSetCodes.find(v => code && v.code === +code)
|
|
||||||
console.log({ code, val })
|
|
||||||
if (!val) return match
|
|
||||||
|
|
||||||
const content = capitalize(val.description) || 'No hint available!'
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
HookSet(
|
|
||||||
<Tooltip content={content}>
|
|
||||||
<Link>{val.identifier}</Link>
|
|
||||||
</Tooltip>
|
|
||||||
)
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return match
|
|
||||||
},
|
|
||||||
input: str
|
|
||||||
})
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{res}
|
|
||||||
<AccountDialog
|
|
||||||
setActiveAccountAddress={setDialogAccount}
|
|
||||||
activeAccountAddress={dialogAccount}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default EnrichLog
|
|
||||||
@@ -7,6 +7,7 @@ import { useRouter } from 'next/router'
|
|||||||
|
|
||||||
import Box from './Box'
|
import Box from './Box'
|
||||||
import Container from './Container'
|
import Container from './Container'
|
||||||
|
import asc from 'assemblyscript/dist/asc'
|
||||||
import { createNewFile, saveFile } from '../state/actions'
|
import { createNewFile, saveFile } from '../state/actions'
|
||||||
import { apiHeaderFiles } from '../state/constants'
|
import { apiHeaderFiles } from '../state/constants'
|
||||||
import state from '../state'
|
import state from '../state'
|
||||||
@@ -210,6 +211,11 @@ const HooksEditor = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
monaco.languages.typescript.typescriptDefaults.addExtraLib(
|
||||||
|
asc.definitionFiles.assembly,
|
||||||
|
'assemblyscript/std/assembly/index.d.ts'
|
||||||
|
)
|
||||||
|
|
||||||
// create the web socket
|
// create the web socket
|
||||||
if (!subscriptionRef.current) {
|
if (!subscriptionRef.current) {
|
||||||
monaco.languages.register({
|
monaco.languages.register({
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
import { useRef, useLayoutEffect, ReactNode, FC, useState } from 'react'
|
import { useRef, useLayoutEffect, ReactNode, FC, useState, useCallback } from 'react'
|
||||||
import { IconProps, Notepad, Prohibit } from 'phosphor-react'
|
import { IconProps, Notepad, Prohibit } from 'phosphor-react'
|
||||||
import useStayScrolled from 'react-stay-scrolled'
|
import useStayScrolled from 'react-stay-scrolled'
|
||||||
import NextLink from 'next/link'
|
import NextLink from 'next/link'
|
||||||
|
|
||||||
import Container from './Container'
|
import Container from './Container'
|
||||||
import LogText from './LogText'
|
import LogText from './LogText'
|
||||||
import { ILog } from '../state'
|
import state, { ILog } from '../state'
|
||||||
import { Pre, Link, Heading, Button, Text, Flex, Box } from '.'
|
import { Pre, Link, Heading, Button, Text, Flex, Box } from '.'
|
||||||
|
import regexifyString from 'regexify-string'
|
||||||
|
import { useSnapshot } from 'valtio'
|
||||||
|
import { AccountDialog } from './Accounts'
|
||||||
|
|
||||||
interface ILogBox {
|
interface ILogBox {
|
||||||
title: string
|
title: string
|
||||||
@@ -140,25 +143,70 @@ const LogBox: FC<ILogBox> = ({
|
|||||||
export const Log: FC<ILog> = ({
|
export const Log: FC<ILog> = ({
|
||||||
type,
|
type,
|
||||||
timestring,
|
timestring,
|
||||||
message,
|
message: _message,
|
||||||
link,
|
link,
|
||||||
linkText,
|
linkText,
|
||||||
defaultCollapsed,
|
defaultCollapsed,
|
||||||
jsonData
|
jsonData: _jsonData
|
||||||
}) => {
|
}) => {
|
||||||
const [expanded, setExpanded] = useState(!defaultCollapsed)
|
const [expanded, setExpanded] = useState(!defaultCollapsed)
|
||||||
|
const { accounts } = useSnapshot(state)
|
||||||
|
const [dialogAccount, setDialogAccount] = useState<string | null>(null)
|
||||||
|
|
||||||
|
const enrichAccounts = useCallback(
|
||||||
|
(str?: string): ReactNode => {
|
||||||
|
if (!str || !accounts.length) return str
|
||||||
|
|
||||||
|
const pattern = `(${accounts.map(acc => acc.address).join('|')})`
|
||||||
|
const res = regexifyString({
|
||||||
|
pattern: new RegExp(pattern, 'gim'),
|
||||||
|
decorator: (match, idx) => {
|
||||||
|
const name = accounts.find(acc => acc.address === match)?.name
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
key={match + idx}
|
||||||
|
as="a"
|
||||||
|
onClick={() => setDialogAccount(match)}
|
||||||
|
title={match}
|
||||||
|
highlighted
|
||||||
|
>
|
||||||
|
{name || match}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
input: str
|
||||||
|
})
|
||||||
|
|
||||||
|
return <>{res}</>
|
||||||
|
},
|
||||||
|
[accounts]
|
||||||
|
)
|
||||||
|
|
||||||
|
let message: ReactNode
|
||||||
|
|
||||||
|
if (typeof _message === 'string') {
|
||||||
|
_message = _message.trim().replace(/\n /gi, '\n')
|
||||||
|
if (_message) message = enrichAccounts(_message)
|
||||||
|
else message = <Text muted>{'""'}</Text>
|
||||||
|
} else {
|
||||||
|
message = _message
|
||||||
|
}
|
||||||
|
|
||||||
|
const jsonData = enrichAccounts(_jsonData)
|
||||||
|
|
||||||
if (message === undefined) message = <Text muted>{'undefined'}</Text>
|
|
||||||
else if (message === '') message = <Text muted>{'""'}</Text>
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<AccountDialog
|
||||||
|
setActiveAccountAddress={setDialogAccount}
|
||||||
|
activeAccountAddress={dialogAccount}
|
||||||
|
/>
|
||||||
<LogText variant={type}>
|
<LogText variant={type}>
|
||||||
{timestring && (
|
{timestring && (
|
||||||
<Text muted monospace>
|
<Text muted monospace>
|
||||||
{timestring}{' '}
|
{timestring}{' '}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
<Pre>{message}</Pre>
|
<Pre>{message} </Pre>
|
||||||
{link && (
|
{link && (
|
||||||
<NextLink href={link} shallow passHref>
|
<NextLink href={link} shallow passHref>
|
||||||
<Link as="a">{linkText}</Link>
|
<Link as="a">{linkText}</Link>
|
||||||
@@ -171,6 +219,7 @@ export const Log: FC<ILog> = ({
|
|||||||
)}
|
)}
|
||||||
{expanded && jsonData && <Pre block>{jsonData}</Pre>}
|
{expanded && jsonData && <Pre block>{jsonData}</Pre>}
|
||||||
</LogText>
|
</LogText>
|
||||||
|
<br />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import { styled } from '../stitches.config'
|
|||||||
const ImageWrapper = styled(Flex, {
|
const ImageWrapper = styled(Flex, {
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
mt: '$2',
|
mt: '$2',
|
||||||
mb: '$6',
|
mb: '$10',
|
||||||
svg: {
|
svg: {
|
||||||
// fill: "red",
|
// fill: "red",
|
||||||
'.angle': {
|
'.angle': {
|
||||||
@@ -66,23 +66,16 @@ const Navigation = () => {
|
|||||||
<Container
|
<Container
|
||||||
css={{
|
css={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center'
|
||||||
px: '$3',
|
|
||||||
'@sm': {
|
|
||||||
px: '$4'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex
|
<Flex
|
||||||
css={{
|
css={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
borderRight: '1px solid $colors$mauve6',
|
||||||
py: '$3',
|
py: '$3',
|
||||||
pr: '$0',
|
pr: '$4'
|
||||||
'@sm': {
|
|
||||||
borderRight: '1px solid $colors$mauve6',
|
|
||||||
pr: '$4'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link href={gistId ? `/develop/${gistId}` : '/develop'} passHref>
|
<Link href={gistId ? `/develop/${gistId}` : '/develop'} passHref>
|
||||||
@@ -91,11 +84,7 @@ const Navigation = () => {
|
|||||||
css={{
|
css={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
color: '$textColor',
|
color: '$textColor'
|
||||||
mr: '$2',
|
|
||||||
'@sm': {
|
|
||||||
mr: '$4'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Logo width="32px" height="32px" />
|
<Logo width="32px" height="32px" />
|
||||||
@@ -103,12 +92,9 @@ const Navigation = () => {
|
|||||||
</Link>
|
</Link>
|
||||||
<Flex
|
<Flex
|
||||||
css={{
|
css={{
|
||||||
|
ml: '$5',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
gap: '1px',
|
gap: '1px'
|
||||||
display: 'none',
|
|
||||||
'@md': {
|
|
||||||
display: 'flex'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{snap.loading ? (
|
{snap.loading ? (
|
||||||
@@ -149,8 +135,8 @@ const Navigation = () => {
|
|||||||
css={{
|
css={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
maxWidth: '1080px',
|
maxWidth: '1080px',
|
||||||
width: '90vw',
|
width: '80vw',
|
||||||
maxHeight: '90%',
|
maxHeight: '80%',
|
||||||
backgroundColor: '$mauve1 !important',
|
backgroundColor: '$mauve1 !important',
|
||||||
overflowY: 'auto',
|
overflowY: 'auto',
|
||||||
background: 'black',
|
background: 'black',
|
||||||
@@ -279,18 +265,15 @@ const Navigation = () => {
|
|||||||
gridTemplateColumns: '1fr',
|
gridTemplateColumns: '1fr',
|
||||||
gridTemplateRows: 'max-content',
|
gridTemplateRows: 'max-content',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
p: '$4',
|
p: '$7',
|
||||||
pb: '$8',
|
pb: '$16',
|
||||||
gap: '$3',
|
gap: '$3',
|
||||||
alignItems: 'normal',
|
alignItems: 'normal',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
backgroundColor: '$mauve1',
|
backgroundColor: '$mauve1',
|
||||||
'@md': {
|
'@md': {
|
||||||
gridTemplateColumns: '1fr 1fr',
|
gridTemplateColumns: '1fr 1fr',
|
||||||
gridTemplateRows: 'max-content',
|
gridTemplateRows: 'max-content'
|
||||||
p: '$7',
|
|
||||||
pb: '$10',
|
|
||||||
paddingRight: '$12'
|
|
||||||
},
|
},
|
||||||
'@lg': {
|
'@lg': {
|
||||||
gridTemplateColumns: '1fr 1fr 1fr',
|
gridTemplateColumns: '1fr 1fr 1fr',
|
||||||
@@ -333,30 +316,23 @@ const Navigation = () => {
|
|||||||
<Flex
|
<Flex
|
||||||
css={{
|
css={{
|
||||||
flexWrap: 'nowrap',
|
flexWrap: 'nowrap',
|
||||||
marginLeft: '$2',
|
marginLeft: '$4',
|
||||||
overflowX: 'scroll',
|
overflowX: 'scroll',
|
||||||
'&::-webkit-scrollbar': {
|
'&::-webkit-scrollbar': {
|
||||||
height: 0,
|
height: 0,
|
||||||
background: 'transparent'
|
background: 'transparent'
|
||||||
},
|
},
|
||||||
scrollbarColor: 'transparent',
|
scrollbarColor: 'transparent',
|
||||||
scrollbarWidth: 'none',
|
scrollbarWidth: 'none'
|
||||||
'@sm': {
|
|
||||||
marginLeft: '$4'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
css={{
|
css={{
|
||||||
ml: '$0',
|
ml: '$4',
|
||||||
gap: '$2',
|
gap: '$3',
|
||||||
flexWrap: 'nowrap',
|
flexWrap: 'nowrap',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
marginLeft: 'auto',
|
marginLeft: 'auto'
|
||||||
'@sm': {
|
|
||||||
marginLeft: '$4',
|
|
||||||
gap: '$3'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const PanelBox = styled('div', {
|
|||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
border: '1px solid $colors$mauve6',
|
border: '1px solid $colors$mauve6',
|
||||||
backgroundColor: '$mauve2',
|
backgroundColor: '$mauve2',
|
||||||
padding: '$5',
|
padding: '$3',
|
||||||
borderRadius: '$sm',
|
borderRadius: '$sm',
|
||||||
fontWeight: 'lighter',
|
fontWeight: 'lighter',
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
import { FC } from 'react'
|
|
||||||
import { Link } from '.'
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
result?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const ResultLink: FC<Props> = ({ result }) => {
|
|
||||||
if (!result) return null
|
|
||||||
let href: string
|
|
||||||
if (result === 'tesSUCCESS') {
|
|
||||||
href = 'https://xrpl.org/tes-success.html'
|
|
||||||
} else {
|
|
||||||
// Going shortcut here because of url structure, if that changes we will do it manually
|
|
||||||
href = `https://xrpl.org/${result.slice(0, 3)}-codes.html`
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<Link as="a" href={href} target="_blank" rel="noopener noreferrer">
|
|
||||||
{result}
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ResultLink
|
|
||||||
@@ -72,12 +72,7 @@ const Tooltip: React.FC<React.ComponentProps<typeof StyledContent> & ITooltip> =
|
|||||||
...rest
|
...rest
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<TooltipPrimitive.Root
|
<TooltipPrimitive.Root open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>
|
||||||
open={open}
|
|
||||||
defaultOpen={defaultOpen}
|
|
||||||
onOpenChange={onOpenChange}
|
|
||||||
delayDuration={100}
|
|
||||||
>
|
|
||||||
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
|
<TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
|
||||||
<StyledContent side="bottom" align="center" {...rest}>
|
<StyledContent side="bottom" align="center" {...rest}>
|
||||||
<div dangerouslySetInnerHTML={{ __html: content }} />
|
<div dangerouslySetInnerHTML={{ __html: content }} />
|
||||||
|
|||||||
@@ -185,16 +185,11 @@ const Transaction: FC<TransactionProps> = ({ header, state: txState, ...props })
|
|||||||
row
|
row
|
||||||
css={{
|
css={{
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
bottom: 0,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
mb: '$2',
|
mb: '$1'
|
||||||
mt: '$1',
|
|
||||||
'@md': {
|
|
||||||
position: 'absolute',
|
|
||||||
left: 0,
|
|
||||||
bottom: 0,
|
|
||||||
mt: '$0',
|
|
||||||
mb: '$2'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -137,14 +137,11 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
row
|
row
|
||||||
fluid
|
fluid
|
||||||
css={{
|
css={{
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'flex-end',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
mb: '$3',
|
mb: '$3',
|
||||||
mt: '1px',
|
mt: '1px',
|
||||||
pr: '1px',
|
pr: '1px'
|
||||||
'@xl': {
|
|
||||||
justifyContent: 'flex-end'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text muted css={{ mr: '$3' }}>
|
<Text muted css={{ mr: '$3' }}>
|
||||||
@@ -155,13 +152,7 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
placeholder="Select transaction type"
|
placeholder="Select transaction type"
|
||||||
options={transactionsOptions}
|
options={transactionsOptions}
|
||||||
hideSelectedOptions
|
hideSelectedOptions
|
||||||
css={{
|
css={{ width: '70%' }}
|
||||||
width: '60%',
|
|
||||||
minWidth: '200px',
|
|
||||||
'@lg': {
|
|
||||||
width: '70%'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
value={selectedTransaction}
|
value={selectedTransaction}
|
||||||
onChange={(tt: any) => handleChangeTxType(tt)}
|
onChange={(tt: any) => handleChangeTxType(tt)}
|
||||||
/>
|
/>
|
||||||
@@ -170,13 +161,10 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
row
|
row
|
||||||
fluid
|
fluid
|
||||||
css={{
|
css={{
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'flex-end',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
mb: '$3',
|
mb: '$3',
|
||||||
pr: '1px',
|
pr: '1px'
|
||||||
'@xl': {
|
|
||||||
justifyContent: 'flex-end'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text muted css={{ mr: '$3' }}>
|
<Text muted css={{ mr: '$3' }}>
|
||||||
@@ -185,13 +173,7 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
<Select
|
<Select
|
||||||
instanceId="from-account"
|
instanceId="from-account"
|
||||||
placeholder="Select your account"
|
placeholder="Select your account"
|
||||||
css={{
|
css={{ width: '70%' }}
|
||||||
width: '60%',
|
|
||||||
minWidth: '200px',
|
|
||||||
'@lg': {
|
|
||||||
width: '70%'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
options={accountOptions}
|
options={accountOptions}
|
||||||
value={selectedAccount}
|
value={selectedAccount}
|
||||||
onChange={(acc: any) => handleSetAccount(acc)} // TODO make react-select have correct types for acc
|
onChange={(acc: any) => handleSetAccount(acc)} // TODO make react-select have correct types for acc
|
||||||
@@ -202,13 +184,10 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
row
|
row
|
||||||
fluid
|
fluid
|
||||||
css={{
|
css={{
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'flex-end',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
mb: '$3',
|
mb: '$3',
|
||||||
pr: '1px',
|
pr: '1px'
|
||||||
'@xl': {
|
|
||||||
justifyContent: 'flex-end'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text muted css={{ mr: '$3' }}>
|
<Text muted css={{ mr: '$3' }}>
|
||||||
@@ -217,13 +196,7 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
<Select
|
<Select
|
||||||
instanceId="to-account"
|
instanceId="to-account"
|
||||||
placeholder="Select the destination account"
|
placeholder="Select the destination account"
|
||||||
css={{
|
css={{ width: '70%' }}
|
||||||
width: '60%',
|
|
||||||
minWidth: '200px',
|
|
||||||
'@lg': {
|
|
||||||
width: '70%'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
options={destAccountOptions}
|
options={destAccountOptions}
|
||||||
value={selectedDestAccount}
|
value={selectedDestAccount}
|
||||||
isClearable
|
isClearable
|
||||||
@@ -256,12 +229,9 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
row
|
row
|
||||||
fluid
|
fluid
|
||||||
css={{
|
css={{
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'flex-end',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
position: 'relative',
|
position: 'relative'
|
||||||
'@xl': {
|
|
||||||
justifyContent: 'flex-end'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text muted css={{ mr: '$3' }}>
|
<Text muted css={{ mr: '$3' }}>
|
||||||
@@ -274,13 +244,9 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
onChange={switchToJson}
|
onChange={switchToJson}
|
||||||
css={{
|
css={{
|
||||||
width: '60%',
|
width: '70%',
|
||||||
minWidth: '200px',
|
|
||||||
flex: 'inherit',
|
flex: 'inherit',
|
||||||
resize: 'vertical',
|
resize: 'vertical'
|
||||||
'@lg': {
|
|
||||||
width: '70%'
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
@@ -305,8 +271,7 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
css={{
|
css={{
|
||||||
width: '60%',
|
width: '70%',
|
||||||
minWidth: '200px',
|
|
||||||
flex: 'inherit',
|
flex: 'inherit',
|
||||||
'-moz-appearance': 'textfield',
|
'-moz-appearance': 'textfield',
|
||||||
'&::-webkit-outer-spin-button': {
|
'&::-webkit-outer-spin-button': {
|
||||||
@@ -316,9 +281,6 @@ export const TxUI: FC<UIProps> = ({ state: txState, setState, estimateFee }) =>
|
|||||||
'&::-webkit-inner-spin-button ': {
|
'&::-webkit-inner-spin-button ': {
|
||||||
'-webkit-appearance': 'none',
|
'-webkit-appearance': 'none',
|
||||||
margin: 0
|
margin: 0
|
||||||
},
|
|
||||||
'@lg': {
|
|
||||||
width: '70%'
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,409 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"code": 1,
|
|
||||||
"identifier": "AMENDMENT_DISABLED",
|
|
||||||
"description": "attempt to HookSet when amendment is not yet enabled."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 2,
|
|
||||||
"identifier": "API_ILLEGAL",
|
|
||||||
"description": "HookSet object contained HookApiVersion for existing HookDefinition"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 3,
|
|
||||||
"identifier": "API_INVALID",
|
|
||||||
"description": "HookSet object contained HookApiVersion for unrecognised hook API "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 4,
|
|
||||||
"identifier": "API_MISSING",
|
|
||||||
"description": "HookSet object lacked HookApiVersion"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 5,
|
|
||||||
"identifier": "BLOCK_ILLEGAL",
|
|
||||||
"description": " a block end instruction moves execution below depth 0 {{}}`}` <= like this"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 6,
|
|
||||||
"identifier": "CALL_ILLEGAL",
|
|
||||||
"description": "wasm tries to call a non-whitelisted function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 7,
|
|
||||||
"identifier": "CALL_INDIRECT",
|
|
||||||
"description": "wasm used call indirect instruction which is disallowed"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 8,
|
|
||||||
"identifier": "CREATE_FLAG",
|
|
||||||
"description": "create operation requires hsoOVERRIDE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 9,
|
|
||||||
"identifier": "DELETE_FIELD",
|
|
||||||
"description": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 10,
|
|
||||||
"identifier": "DELETE_FLAG",
|
|
||||||
"description": "delete operation requires hsoOVERRIDE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 11,
|
|
||||||
"identifier": "DELETE_NOTHING",
|
|
||||||
"description": "delete operation would delete nothing"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 12,
|
|
||||||
"identifier": "EXPORTS_MISSING",
|
|
||||||
"description": "hook did not export *any* functions (should be cbak, hook)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 13,
|
|
||||||
"identifier": "EXPORT_CBAK_FUNC",
|
|
||||||
"description": "hook did not export correct func def int64_t cbak(uint32_t)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 14,
|
|
||||||
"identifier": "EXPORT_HOOK_FUNC",
|
|
||||||
"description": "hook did not export correct func def int64_t hook(uint32_t)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": 15,
|
|
||||||
"identifier": "EXPORT_MISSING",
|
|
||||||
"description": "distinct from export*S*_missing, either hook or cbak is missing"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "FLAGS_INVALID",
|
|
||||||
"code": 16,
|
|
||||||
"description": "HookSet flags were invalid for specified operation "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "FUNCS_MISSING",
|
|
||||||
"code": 17,
|
|
||||||
"description": "hook did not include function code for any functions "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "FUNC_PARAM_INVALID",
|
|
||||||
"code": 18,
|
|
||||||
"description": "parameter types may only be i32 i64 u32 u64 "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "FUNC_RETURN_COUNT",
|
|
||||||
"code": 19,
|
|
||||||
"description": "a function type is defined in the wasm which returns > 1 return value "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "FUNC_RETURN_INVALID",
|
|
||||||
"code": 20,
|
|
||||||
"description": "a function type does not return i32 i64 u32 or u64 "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "FUNC_TYPELESS",
|
|
||||||
"code": 21,
|
|
||||||
"description": "hook defined hook/cbak but their type is not defined in wasm "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "FUNC_TYPE_INVALID",
|
|
||||||
"code": 22,
|
|
||||||
"description": "malformed and illegal wasm in the func type section "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "GRANTS_EMPTY",
|
|
||||||
"code": 23,
|
|
||||||
"description": "HookSet object contained an empty grants array (you should remove it) "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "GRANTS_EXCESS",
|
|
||||||
"code": 24,
|
|
||||||
"description": "HookSet object cotnained a grants array with too many grants "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "GRANTS_FIELD",
|
|
||||||
"code": 25,
|
|
||||||
"description": "HookSet object contained a grant without Authorize or HookHash "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "GRANTS_ILLEGAL",
|
|
||||||
"code": 26,
|
|
||||||
"description": "Hookset object contained grants array which contained a non Grant object "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "GUARD_IMPORT",
|
|
||||||
"code": 27,
|
|
||||||
"description": "guard import is missing "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "GUARD_MISSING",
|
|
||||||
"code": 28,
|
|
||||||
"description": "guard call missing at top of loop "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "GUARD_PARAMETERS",
|
|
||||||
"code": 29,
|
|
||||||
"description": "guard called but did not use constant expressions for params "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HASH_OR_CODE",
|
|
||||||
"code": 30,
|
|
||||||
"description": "HookSet object can contain only one of CreateCode and HookHash "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOKON_MISSING",
|
|
||||||
"code": 31,
|
|
||||||
"description": "HookSet object did not contain HookOn but should have "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOKS_ARRAY_BAD",
|
|
||||||
"code": 32,
|
|
||||||
"description": "attempt to HookSet with a Hooks array containing a non-Hook obj "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOKS_ARRAY_BLANK",
|
|
||||||
"code": 33,
|
|
||||||
"description": "all hook set objs were blank "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOKS_ARRAY_EMPTY",
|
|
||||||
"code": 34,
|
|
||||||
"description": "attempt to HookSet with an empty Hooks array "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOKS_ARRAY_MISSING",
|
|
||||||
"code": 35,
|
|
||||||
"description": "attempt to HookSet without a Hooks array "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOKS_ARRAY_TOO_BIG",
|
|
||||||
"code": 36,
|
|
||||||
"description": "attempt to HookSet with a Hooks array beyond the chain size limit "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOK_ADD",
|
|
||||||
"code": 37,
|
|
||||||
"description": "Informational: adding ltHook to directory "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOK_DEF_MISSING",
|
|
||||||
"code": 38,
|
|
||||||
"description": "attempt to reference a hook definition (by hash) that is not on ledger "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOK_DELETE",
|
|
||||||
"code": 39,
|
|
||||||
"description": "unable to delete ltHook from owner "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOK_INVALID_FIELD",
|
|
||||||
"code": 40,
|
|
||||||
"description": "HookSetObj contained an illegal/unexpected field "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOK_PARAMS_COUNT",
|
|
||||||
"code": 41,
|
|
||||||
"description": "hookset obj would create too many hook parameters "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOK_PARAM_SIZE",
|
|
||||||
"code": 42,
|
|
||||||
"description": "hookset obj sets a parameter or value that exceeds max allowable size "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "IMPORTS_MISSING",
|
|
||||||
"code": 43,
|
|
||||||
"description": "hook must import guard, and accept/rollback "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "IMPORT_ILLEGAL",
|
|
||||||
"code": 44,
|
|
||||||
"description": "attempted import of a non-whitelisted function "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "IMPORT_MODULE_BAD",
|
|
||||||
"code": 45,
|
|
||||||
"description": "hook attempted to specify no or a bad import module "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "IMPORT_MODULE_ENV",
|
|
||||||
"code": 46,
|
|
||||||
"description": "hook attempted to specify import module not named env "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "IMPORT_NAME_BAD",
|
|
||||||
"code": 47,
|
|
||||||
"description": "import name was too short or too long "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "INSTALL_FLAG",
|
|
||||||
"code": 48,
|
|
||||||
"description": "install operation requires hsoOVERRIDE "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "INSTALL_MISSING",
|
|
||||||
"code": 49,
|
|
||||||
"description": "install operation specifies hookhash which doesn't exist on the ledger "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "INSTRUCTION_COUNT",
|
|
||||||
"code": 50,
|
|
||||||
"description": "worst case execution instruction count as computed by HookSet "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "INSTRUCTION_EXCESS",
|
|
||||||
"code": 51,
|
|
||||||
"description": "worst case execution instruction count was too large "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "MEMORY_GROW",
|
|
||||||
"code": 52,
|
|
||||||
"description": "memory.grow instruction is present but disallowed "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NAMESPACE_MISSING",
|
|
||||||
"code": 53,
|
|
||||||
"description": "HookSet object lacked HookNamespace "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE",
|
|
||||||
"code": 54,
|
|
||||||
"description": "Informational: a namespace is being deleted "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_ACCOUNT",
|
|
||||||
"code": 55,
|
|
||||||
"description": "nsdelete tried to delete ns from a non-existing account "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_COUNT",
|
|
||||||
"code": 56,
|
|
||||||
"description": "namespace state count less than 0 / overflow "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_DIR",
|
|
||||||
"code": 57,
|
|
||||||
"description": "could not delete directory node in ledger "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_DIRECTORY",
|
|
||||||
"code": 58,
|
|
||||||
"description": "nsdelete operation failed to delete ns directory "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_DIR_ENTRY",
|
|
||||||
"code": 59,
|
|
||||||
"description": "nsdelete operation failed due to bad entry in ns directory "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_ENTRY",
|
|
||||||
"code": 60,
|
|
||||||
"description": "nsdelete operation failed due to missing hook state entry "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_FIELD",
|
|
||||||
"code": 61
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_FLAGS",
|
|
||||||
"code": 62
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_NONSTATE",
|
|
||||||
"code": 63,
|
|
||||||
"description": "nsdelete operation failed due to the presence of a non-hookstate obj "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "NSDELETE_NOTHING",
|
|
||||||
"code": 64,
|
|
||||||
"description": "hsfNSDELETE provided but nothing to delete "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "OPERATION_INVALID",
|
|
||||||
"code": 65,
|
|
||||||
"description": "could not deduce an operation from the provided hookset obj "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "OVERRIDE_MISSING",
|
|
||||||
"code": 66,
|
|
||||||
"description": "HookSet object was trying to update or delete a hook but lacked hsfOVERRIDE "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "PARAMETERS_FIELD",
|
|
||||||
"code": 67,
|
|
||||||
"description": "HookParameters contained a HookParameter with an invalid key in it "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "PARAMETERS_ILLEGAL",
|
|
||||||
"code": 68,
|
|
||||||
"description": "HookParameters contained something other than a HookParameter "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "PARAMETERS_NAME",
|
|
||||||
"code": 69,
|
|
||||||
"description": "HookParameters contained a HookParameter which lacked ParameterName field "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "PARAM_HOOK_CBAK",
|
|
||||||
"code": 70,
|
|
||||||
"description": "hook and cbak must take exactly one u32 parameter "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "RETURN_HOOK_CBAK",
|
|
||||||
"code": 71,
|
|
||||||
"description": "hook and cbak must retunr i64 "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "SHORT_HOOK",
|
|
||||||
"code": 72,
|
|
||||||
"description": "web assembly byte code ended abruptly "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "TYPE_INVALID",
|
|
||||||
"code": 73,
|
|
||||||
"description": "malformed and illegal wasm specifying an illegal local var type "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "WASM_BAD_MAGIC",
|
|
||||||
"code": 74,
|
|
||||||
"description": "wasm magic number missing or not wasm "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "WASM_INVALID",
|
|
||||||
"code": 75,
|
|
||||||
"description": "set hook operation would set invalid wasm "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "WASM_PARSE_LOOP",
|
|
||||||
"code": 76,
|
|
||||||
"description": "wasm section parsing resulted in an infinite loop "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "WASM_SMOKE_TEST",
|
|
||||||
"code": 77,
|
|
||||||
"description": "Informational: first attempt to load wasm into wasm runtime "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "WASM_TEST_FAILURE",
|
|
||||||
"code": 78,
|
|
||||||
"description": "the smoke test failed "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "WASM_TOO_BIG",
|
|
||||||
"code": 79,
|
|
||||||
"description": "set hook would exceed maximum hook size "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "WASM_TOO_SMALL",
|
|
||||||
"code": 80
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "WASM_VALIDATION",
|
|
||||||
"code": 81,
|
|
||||||
"description": "a generic error while parsing wasm, usually leb128 overflow"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "HOOK_CBAK_DIFF_TYPES",
|
|
||||||
"code": 82,
|
|
||||||
"description": "hook and cbak function definitions were different"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -8,8 +8,16 @@ module.exports = {
|
|||||||
config.resolve.alias['vscode'] = require.resolve(
|
config.resolve.alias['vscode'] = require.resolve(
|
||||||
'@codingame/monaco-languageclient/lib/vscode-compatibility'
|
'@codingame/monaco-languageclient/lib/vscode-compatibility'
|
||||||
)
|
)
|
||||||
|
config.experiments = {
|
||||||
|
topLevelAwait: true,
|
||||||
|
layers: true
|
||||||
|
}
|
||||||
if (!isServer) {
|
if (!isServer) {
|
||||||
config.resolve.fallback.fs = false
|
config.resolve.fallback = {
|
||||||
|
...config.resolve.fallback,
|
||||||
|
fs: false,
|
||||||
|
module: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
config.module.rules.push({
|
config.module.rules.push({
|
||||||
test: /\.md$/,
|
test: /\.md$/,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
"@radix-ui/react-switch": "^0.1.5",
|
"@radix-ui/react-switch": "^0.1.5",
|
||||||
"@radix-ui/react-tooltip": "^0.1.7",
|
"@radix-ui/react-tooltip": "^0.1.7",
|
||||||
"@stitches/react": "^1.2.8",
|
"@stitches/react": "^1.2.8",
|
||||||
|
"assemblyscript": "^0.20.19",
|
||||||
"base64-js": "^1.5.1",
|
"base64-js": "^1.5.1",
|
||||||
"comment-parser": "^1.3.1",
|
"comment-parser": "^1.3.1",
|
||||||
"dinero.js": "^1.9.1",
|
"dinero.js": "^1.9.1",
|
||||||
|
|||||||
@@ -159,7 +159,8 @@ const Home: NextPage = () => {
|
|||||||
>
|
>
|
||||||
<main style={{ display: 'flex', flex: 1, position: 'relative' }}>
|
<main style={{ display: 'flex', flex: 1, position: 'relative' }}>
|
||||||
<HooksEditor />
|
<HooksEditor />
|
||||||
{snap.files[snap.active]?.name?.split('.')?.[1]?.toLowerCase() === 'c' && (
|
{(snap.files[snap.active]?.name?.split('.')?.[1]?.toLowerCase() === 'c' ||
|
||||||
|
snap.files[snap.active]?.name?.split('.')?.[1]?.toLowerCase() === 'ts') && (
|
||||||
<Hotkeys
|
<Hotkeys
|
||||||
keyName="command+b,ctrl+b"
|
keyName="command+b,ctrl+b"
|
||||||
onKeyDown={() => !snap.compiling && snap.files.length && compileCode(snap.active)}
|
onKeyDown={() => !snap.compiling && snap.files.length && compileCode(snap.active)}
|
||||||
@@ -185,11 +186,13 @@ const Home: NextPage = () => {
|
|||||||
<Play weight="bold" size="16px" />
|
<Play weight="bold" size="16px" />
|
||||||
Compile to Wasm
|
Compile to Wasm
|
||||||
</Button>
|
</Button>
|
||||||
<Popover content={<CompilerSettings />}>
|
{snap.files[snap.active].language === 'c' && (
|
||||||
<Button variant="primary" css={{ px: '10px' }}>
|
<Popover content={<CompilerSettings />}>
|
||||||
<Gear size="16px" />
|
<Button variant="primary" css={{ px: '10px' }}>
|
||||||
</Button>
|
<Gear size="16px" />
|
||||||
</Popover>
|
</Button>
|
||||||
|
</Popover>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
</Hotkeys>
|
</Hotkeys>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ const Test = () => {
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
p: '$3 $2'
|
p: '$3 $2'
|
||||||
}}
|
}}
|
||||||
className="split-mobile-forceAutoHeight"
|
|
||||||
>
|
>
|
||||||
<Split
|
<Split
|
||||||
direction="horizontal"
|
direction="horizontal"
|
||||||
@@ -83,7 +82,6 @@ const Test = () => {
|
|||||||
height: '100%'
|
height: '100%'
|
||||||
}}
|
}}
|
||||||
onDragEnd={e => saveSplit('testHorizontal', e)}
|
onDragEnd={e => saveSplit('testHorizontal', e)}
|
||||||
className="split-mobile-forceVertical"
|
|
||||||
>
|
>
|
||||||
<Box css={{ width: '55%', px: '$2' }}>
|
<Box css={{ width: '55%', px: '$2' }}>
|
||||||
<Tabs
|
<Tabs
|
||||||
@@ -107,18 +105,7 @@ const Test = () => {
|
|||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Box>
|
</Box>
|
||||||
<Box
|
<Box css={{ width: '45%', mx: '$2', height: '100%' }}>
|
||||||
css={{
|
|
||||||
width: '45%',
|
|
||||||
mx: '$0',
|
|
||||||
mt: '$1',
|
|
||||||
height: '100%',
|
|
||||||
'@md': {
|
|
||||||
mx: '$2',
|
|
||||||
mt: '$0'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Accounts card hideDeployBtn showHookStats />
|
<Accounts card hideDeployBtn showHookStats />
|
||||||
</Box>
|
</Box>
|
||||||
</Split>
|
</Split>
|
||||||
@@ -144,7 +131,6 @@ const Test = () => {
|
|||||||
<Flex>
|
<Flex>
|
||||||
<Split
|
<Split
|
||||||
direction="horizontal"
|
direction="horizontal"
|
||||||
className="split-mobile-forceVertical"
|
|
||||||
sizes={[50, 50]}
|
sizes={[50, 50]}
|
||||||
minSize={[320, 160]}
|
minSize={[320, 160]}
|
||||||
gutterSize={4}
|
gutterSize={4}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { ref } from 'valtio'
|
|||||||
* out of it and store both in global state.
|
* out of it and store both in global state.
|
||||||
*/
|
*/
|
||||||
export const compileCode = async (activeId: number) => {
|
export const compileCode = async (activeId: number) => {
|
||||||
|
let asc: typeof import('assemblyscript/dist/asc') | undefined
|
||||||
// Save the file to global state
|
// Save the file to global state
|
||||||
saveFile(false, activeId)
|
saveFile(false, activeId)
|
||||||
if (!process.env.NEXT_PUBLIC_COMPILE_API_ENDPOINT) {
|
if (!process.env.NEXT_PUBLIC_COMPILE_API_ENDPOINT) {
|
||||||
@@ -25,6 +26,85 @@ export const compileCode = async (activeId: number) => {
|
|||||||
}
|
}
|
||||||
// Set loading state to true
|
// Set loading state to true
|
||||||
state.compiling = true
|
state.compiling = true
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
// IF AssemblyScript
|
||||||
|
if (
|
||||||
|
state.files[activeId].language.toLowerCase() === 'ts' ||
|
||||||
|
state.files[activeId].language.toLowerCase() === 'typescript'
|
||||||
|
) {
|
||||||
|
if (!asc) {
|
||||||
|
asc = await import('assemblyscript/dist/asc')
|
||||||
|
}
|
||||||
|
const files: { [key: string]: string } = {}
|
||||||
|
state.files.forEach(file => {
|
||||||
|
files[file.name] = file.content
|
||||||
|
})
|
||||||
|
const res = await asc.main(
|
||||||
|
[
|
||||||
|
state.files[activeId].name,
|
||||||
|
'--textFile',
|
||||||
|
'-o',
|
||||||
|
state.files[activeId].name,
|
||||||
|
'--runtime',
|
||||||
|
'minimal',
|
||||||
|
'-O3'
|
||||||
|
],
|
||||||
|
{
|
||||||
|
readFile: (name, baseDir) => {
|
||||||
|
console.log('--> ', name)
|
||||||
|
const currentFile = state.files.find(file => file.name === name)
|
||||||
|
if (currentFile) {
|
||||||
|
return currentFile.content
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
},
|
||||||
|
writeFile: (name, data, baseDir) => {
|
||||||
|
console.log(name)
|
||||||
|
const curr = state.files.find(file => file.name === name)
|
||||||
|
if (curr) {
|
||||||
|
curr.compiledContent = ref(data)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
listFiles: (dirname, baseDir) => {
|
||||||
|
console.log('listFiles: ' + dirname + ', baseDir=' + baseDir)
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
// In case you want to compile just single file
|
||||||
|
// const res = await asc.compileString(state.files[activeId].content, {
|
||||||
|
// optimizeLevel: 3,
|
||||||
|
// runtime: 'stub',
|
||||||
|
// })
|
||||||
|
|
||||||
|
if (res.error?.message) {
|
||||||
|
state.compiling = false
|
||||||
|
state.logs.push({
|
||||||
|
type: 'error',
|
||||||
|
message: res.error.message
|
||||||
|
})
|
||||||
|
state.logs.push({
|
||||||
|
type: 'error',
|
||||||
|
message: res.stderr.toString()
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (res.stdout) {
|
||||||
|
const wat = res.stdout.toString()
|
||||||
|
state.files[activeId].lastCompiled = new Date()
|
||||||
|
state.files[activeId].compiledWatContent = wat
|
||||||
|
state.files[activeId].compiledValueSnapshot = state.files[activeId].content
|
||||||
|
state.logs.push({
|
||||||
|
type: 'success',
|
||||||
|
message: `File ${state.files?.[activeId]?.name} compiled successfully. Ready to deploy.`,
|
||||||
|
link: Router.asPath.replace('develop', 'deploy'),
|
||||||
|
linkText: 'Go to deploy'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
state.compiling = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
state.logs = []
|
state.logs = []
|
||||||
const file = state.files[activeId]
|
const file = state.files[activeId]
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { Link } from '../../components'
|
|||||||
import { ref } from 'valtio'
|
import { ref } from 'valtio'
|
||||||
import estimateFee from '../../utils/estimateFee'
|
import estimateFee from '../../utils/estimateFee'
|
||||||
import { SetHookData } from '../../utils/setHook'
|
import { SetHookData } from '../../utils/setHook'
|
||||||
import ResultLink from '../../components/ResultLink'
|
|
||||||
|
|
||||||
export const sha256 = async (string: string) => {
|
export const sha256 = async (string: string) => {
|
||||||
const utf8 = new TextEncoder().encode(string)
|
const utf8 = new TextEncoder().encode(string)
|
||||||
@@ -25,7 +24,7 @@ function toHex(str: string) {
|
|||||||
return result.toUpperCase()
|
return result.toUpperCase()
|
||||||
}
|
}
|
||||||
|
|
||||||
function arrayBufferToHex(arrayBuffer?: ArrayBuffer | null) {
|
function arrayBufferToHex(arrayBuffer?: ArrayBuffer | Uint8Array | null) {
|
||||||
if (!arrayBuffer) {
|
if (!arrayBuffer) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
@@ -37,7 +36,7 @@ function arrayBufferToHex(arrayBuffer?: ArrayBuffer | null) {
|
|||||||
throw new TypeError('Expected input to be an ArrayBuffer')
|
throw new TypeError('Expected input to be an ArrayBuffer')
|
||||||
}
|
}
|
||||||
|
|
||||||
var view = new Uint8Array(arrayBuffer)
|
var view = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer)
|
||||||
var result = ''
|
var result = ''
|
||||||
var value
|
var value
|
||||||
|
|
||||||
@@ -145,25 +144,6 @@ export const deployHook = async (account: IAccount & { name?: string }, data: Se
|
|||||||
tx_blob: signedTransaction
|
tx_blob: signedTransaction
|
||||||
})
|
})
|
||||||
|
|
||||||
const txHash = submitRes.tx_json?.hash
|
|
||||||
const resultMsg = ref(
|
|
||||||
<>
|
|
||||||
[<ResultLink result={submitRes.engine_result} />] {submitRes.engine_result_message}{' '}
|
|
||||||
{txHash && (
|
|
||||||
<>
|
|
||||||
Transaction hash:{' '}
|
|
||||||
<Link
|
|
||||||
as="a"
|
|
||||||
href={`https://${process.env.NEXT_PUBLIC_EXPLORER_URL}/${txHash}`}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
{txHash}
|
|
||||||
</Link>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
if (submitRes.engine_result === 'tesSUCCESS') {
|
if (submitRes.engine_result === 'tesSUCCESS') {
|
||||||
state.deployLogs.push({
|
state.deployLogs.push({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -171,17 +151,27 @@ export const deployHook = async (account: IAccount & { name?: string }, data: Se
|
|||||||
})
|
})
|
||||||
state.deployLogs.push({
|
state.deployLogs.push({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: resultMsg
|
message: ref(
|
||||||
})
|
<>
|
||||||
} else if (submitRes.engine_result) {
|
[{submitRes.engine_result}] {submitRes.engine_result_message} Transaction hash:{' '}
|
||||||
state.deployLogs.push({
|
<Link
|
||||||
type: 'error',
|
as="a"
|
||||||
message: resultMsg
|
href={`https://${process.env.NEXT_PUBLIC_EXPLORER_URL}/${submitRes.tx_json?.hash}`}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
{submitRes.tx_json?.hash}
|
||||||
|
</Link>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
// message: `[${submitRes.engine_result}] ${submitRes.engine_result_message} Validated ledger index: ${submitRes.validated_ledger_index}`,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
state.deployLogs.push({
|
state.deployLogs.push({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: `[${submitRes.error}] ${submitRes.error_exception}`
|
message: `[${submitRes.engine_result || submitRes.error}] ${
|
||||||
|
submitRes.engine_result_message || submitRes.error_exception
|
||||||
|
}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
import { derive, sign } from 'xrpl-accountlib'
|
|
||||||
|
|
||||||
import state from '..'
|
|
||||||
import type { IAccount } from '..'
|
|
||||||
import ResultLink from '../../components/ResultLink'
|
|
||||||
import { ref } from 'valtio'
|
|
||||||
|
|
||||||
interface TransactionOptions {
|
|
||||||
TransactionType: string
|
|
||||||
Account?: string
|
|
||||||
Fee?: string
|
|
||||||
Destination?: string
|
|
||||||
[index: string]: any
|
|
||||||
}
|
|
||||||
interface OtherOptions {
|
|
||||||
logPrefix?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export const sendTransaction = async (
|
|
||||||
account: IAccount,
|
|
||||||
txOptions: TransactionOptions,
|
|
||||||
options?: OtherOptions
|
|
||||||
) => {
|
|
||||||
if (!state.client) throw Error('XRPL client not initalized')
|
|
||||||
|
|
||||||
const { Fee = '1000', ...opts } = txOptions
|
|
||||||
const tx: TransactionOptions = {
|
|
||||||
Account: account.address,
|
|
||||||
Sequence: account.sequence,
|
|
||||||
Fee, // TODO auto-fillable default
|
|
||||||
...opts
|
|
||||||
}
|
|
||||||
const { logPrefix = '' } = options || {}
|
|
||||||
try {
|
|
||||||
const signedAccount = derive.familySeed(account.secret)
|
|
||||||
const { signedTransaction } = sign(tx, signedAccount)
|
|
||||||
const response = await state.client.send({
|
|
||||||
command: 'submit',
|
|
||||||
tx_blob: signedTransaction
|
|
||||||
})
|
|
||||||
|
|
||||||
const resultMsg = ref(
|
|
||||||
<>
|
|
||||||
{logPrefix}[<ResultLink result={response.engine_result} />] {response.engine_result_message}
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
if (response.engine_result === 'tesSUCCESS') {
|
|
||||||
state.transactionLogs.push({
|
|
||||||
type: 'success',
|
|
||||||
message: resultMsg
|
|
||||||
})
|
|
||||||
} else if (response.engine_result) {
|
|
||||||
state.transactionLogs.push({
|
|
||||||
type: 'error',
|
|
||||||
message: resultMsg
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
state.transactionLogs.push({
|
|
||||||
type: 'error',
|
|
||||||
message: `${logPrefix}[${response.error}] ${response.error_exception}`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const currAcc = state.accounts.find(acc => acc.address === account.address)
|
|
||||||
if (currAcc && response.account_sequence_next) {
|
|
||||||
currAcc.sequence = response.account_sequence_next
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err)
|
|
||||||
state.transactionLogs.push({
|
|
||||||
type: 'error',
|
|
||||||
message:
|
|
||||||
err instanceof Error
|
|
||||||
? `${logPrefix}Error: ${err.message}`
|
|
||||||
: `${logPrefix}Something went wrong, try again later`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,7 @@ export interface IFile {
|
|||||||
language: string
|
language: string
|
||||||
content: string
|
content: string
|
||||||
compiledValueSnapshot?: string
|
compiledValueSnapshot?: string
|
||||||
compiledContent?: ArrayBuffer | null
|
compiledContent?: ArrayBuffer | Uint8Array | null
|
||||||
compiledWatContent?: string | null
|
compiledWatContent?: string | null
|
||||||
lastCompiled?: Date
|
lastCompiled?: Date
|
||||||
containsErrors?: boolean
|
containsErrors?: boolean
|
||||||
|
|||||||
@@ -54,15 +54,3 @@ html.light .gutter-horizontal:hover {
|
|||||||
.monaco-editor .monaco-hover {
|
.monaco-editor .monaco-hover {
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 48rem) {
|
|
||||||
.split-mobile-forceAutoHeight {
|
|
||||||
height: auto !important;
|
|
||||||
}
|
|
||||||
.split-mobile-forceVertical {
|
|
||||||
flex-direction: column !important;
|
|
||||||
}
|
|
||||||
.split-mobile-forceVertical > div {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
18
yarn.lock
18
yarn.lock
@@ -1289,6 +1289,14 @@ array.prototype.flatmap@^1.2.5:
|
|||||||
define-properties "^1.1.3"
|
define-properties "^1.1.3"
|
||||||
es-abstract "^1.19.0"
|
es-abstract "^1.19.0"
|
||||||
|
|
||||||
|
assemblyscript@^0.20.19:
|
||||||
|
version "0.20.19"
|
||||||
|
resolved "https://registry.yarnpkg.com/assemblyscript/-/assemblyscript-0.20.19.tgz#7c29f506a31d526f7d7e3b22908cc8774b378681"
|
||||||
|
integrity sha512-IJN2CaAwCdRgTSZz3GiuYyXtXIjETBrlzky9ww9jFlEgH8i0pNFt6MAS3viogkofem+rcY6Fhr/clk+b6LWLBw==
|
||||||
|
dependencies:
|
||||||
|
binaryen "109.0.0-nightly.20220813"
|
||||||
|
long "^5.2.0"
|
||||||
|
|
||||||
assert@^2.0.0:
|
assert@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz"
|
resolved "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz"
|
||||||
@@ -1392,6 +1400,11 @@ bignumber.js@^9.0.0:
|
|||||||
resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz"
|
resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz"
|
||||||
integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==
|
integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==
|
||||||
|
|
||||||
|
binaryen@109.0.0-nightly.20220813:
|
||||||
|
version "109.0.0-nightly.20220813"
|
||||||
|
resolved "https://registry.yarnpkg.com/binaryen/-/binaryen-109.0.0-nightly.20220813.tgz#6928acf8820fc1270d41dbb157c0c2337a067d20"
|
||||||
|
integrity sha512-u85Ti3LiGRrV0HqdNDRknalkx7QiCSL0jNsEsT522nnZacWxUaSJEILphxc2OnzmHVtdiWBE3c4lEzlU3ZEyDw==
|
||||||
|
|
||||||
bindings@^1.3.0:
|
bindings@^1.3.0:
|
||||||
version "1.5.0"
|
version "1.5.0"
|
||||||
resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz"
|
resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz"
|
||||||
@@ -2960,6 +2973,11 @@ lodash@^4.17.15, lodash@^4.17.4:
|
|||||||
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
|
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
|
||||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||||
|
|
||||||
|
long@^5.2.0:
|
||||||
|
version "5.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/long/-/long-5.2.0.tgz#2696dadf4b4da2ce3f6f6b89186085d94d52fd61"
|
||||||
|
integrity sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==
|
||||||
|
|
||||||
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
|
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
|
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
|
||||||
|
|||||||
Reference in New Issue
Block a user