Skip to content

Commit

Permalink
feat(demo-app): ✨ add tx trace example
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideSegullo committed Mar 4, 2023
1 parent b17444a commit a53bad7
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
18 changes: 15 additions & 3 deletions apps/demo-app/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
import styled from '@emotion/styled';

import NxWelcome from './nx-welcome';

import { Route, Routes, Link } from 'react-router-dom';
import { useMachine } from '@xstate/react';
import { txTraceMachine } from '@nabla-studio/txs-tracer-core'
import { useEffect } from 'react';

const StyledApp = styled.div`
// Your style here
`;

export function App() {
const [state, send] = useMachine(txTraceMachine, {
context: {
...txTraceMachine.context,
subscribeTimeout: 10_000,
query: "message.action='/osmosis.gamm.v1beta1.MsgSwapExactAmountIn'"
},
});

console.log(state.context.txs);

return (
<StyledApp>
<NxWelcome title="demo-app" />
<p>{state.value.toString()}</p>
<button onClick={() => send({ type: 'TRACE' })}>Trace</button>

{/* START: routes */}
{/* These routes and navigation have been generated for you */}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@cosmjs/tendermint-rpc": "^0.29.5",
"@emotion/react": "11.10.6",
"@emotion/styled": "11.10.6",
"@xstate/react": "^3.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-router-dom": "6.8.1",
Expand Down
43 changes: 43 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a53bad7

Please sign in to comment.