@xyo-network/react-chain-boundwitness 1.7.7 → 1.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,7 @@ import {
13
13
  HeadingPaper,
14
14
  } from '@xyo-network/react-boundwitness-plugin'
15
15
  import { useTxsFromBlock } from '@xyo-network/react-chain-blockchain'
16
+ import type { EventNoun } from '@xyo-network/react-event'
16
17
  import { usePayloadHash } from '@xyo-network/react-shared'
17
18
  import type { HydratedBlock, XyoViewer } from '@xyo-network/xl1-protocol'
18
19
  import { isTransactionBoundWitness } from '@xyo-network/xl1-protocol'
@@ -73,6 +74,7 @@ export const BlockBoundWitnessDetails = ({
73
74
  <PayloadTableFlexbox<TransactionBoundWitnessEvents>
74
75
  IconComponent={<GrTransaction />}
75
76
  eventNoun="transaction"
77
+ clickableFields={['hash']}
76
78
  hashes={txHashes}
77
79
  headingTitle="Transactions"
78
80
  schemas={txSchemas}
@@ -81,12 +83,11 @@ export const BlockBoundWitnessDetails = ({
81
83
  )}
82
84
  <FlexCol alignItems="stretch" rowGap={1} mb={1}>
83
85
  <HeadingPaper IconComponent={<VscSymbolNamespace />} heading="Payloads" />
84
- <BoundWitnessPayloadsTable boundwitness={boundWitness} />
86
+ <BoundWitnessPayloadsTable boundwitness={boundWitness} eventNoun="payload" clickableFields={['hash']} />
85
87
  </FlexCol>
86
88
  {hasNonTxBoundWitnesses
87
89
  ? (
88
- <PayloadTableFlexbox<TransactionBoundWitnessEvents>
89
- clickableFields={['hash']}
90
+ <PayloadTableFlexbox<EventNoun>
90
91
  IconComponent={<VscSymbolMethod />}
91
92
  eventNoun="boundwitness"
92
93
  hashes={nonTxBwHashes}
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import { Account } from '@xyo-network/account'
3
+ import { useEvent } from '@xyo-network/react-event'
3
4
  import type { HashPayload, HydratedTransaction } from '@xyo-network/xl1-protocol'
4
5
  import { buildTransaction } from '@xyo-network/xl1-protocol-sdk'
5
6
  import React from 'react'
@@ -22,15 +23,27 @@ const invalidTx = [builtInvalidTx[0], builtInvalidTx[1].filter(payload => payloa
22
23
 
23
24
  const Template: StoryFn<typeof TransactionBoundWitnessDetails> = args => <TransactionBoundWitnessDetails {...args} />
24
25
 
26
+ const TemplateWithEvents: StoryFn<typeof TransactionBoundWitnessDetails> = (args) => {
27
+ const [ref] = useEvent<HTMLElement>((noun, verb, data) => {
28
+ alert(`${noun}, ${verb}, ${data}`)
29
+ })
30
+ return (
31
+ <TransactionBoundWitnessDetails ref={ref} {...args} />
32
+ )
33
+ }
34
+
25
35
  const Default = Template.bind({})
26
36
  Default.args = {}
27
37
 
28
38
  const WithData = Template.bind({})
29
39
  WithData.args = { transaction: tx }
30
40
 
41
+ const WithDataEvents = TemplateWithEvents.bind({})
42
+ WithDataEvents.args = { transaction: tx }
43
+
31
44
  const WithInvalidData = Template.bind({})
32
45
  WithInvalidData.args = { transaction: invalidTx }
33
46
 
34
47
  export {
35
- Default, WithData, WithInvalidData,
48
+ Default, WithData, WithDataEvents, WithInvalidData,
36
49
  }
@@ -2,6 +2,7 @@ import { ErrorRender } from '@xylabs/react-error'
2
2
  import { type FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'
3
3
  import { usePromise } from '@xylabs/react-promise'
4
4
  import { HydratedTransactionWrapper } from '@xyo-network/chain-wrappers'
5
+ import type { ClickableFields } from '@xyo-network/react-boundwitness-plugin'
5
6
  import {
6
7
  BoundWitnessSignatureTable, HashHeadingPaper, HeadingPaper,
7
8
  } from '@xyo-network/react-boundwitness-plugin'
@@ -10,7 +11,6 @@ import React from 'react'
10
11
  import { FaSignature } from 'react-icons/fa'
11
12
  import { VscSymbolNamespace } from 'react-icons/vsc'
12
13
 
13
- import type { ClickableFields } from '../PayloadTable.tsx'
14
14
  import { PayloadTableFlexbox } from '../PayloadTable.tsx'
15
15
  import { TransactionActions, TransactionBoundWitnessCard } from './card/index.ts'
16
16
  import { useTransactionPayloadTypes } from './hooks/index.ts'
@@ -50,6 +50,8 @@ export const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDet
50
50
  <ErrorRender key={index} error={error} scope="referencedPayloadsError:TransactionBoundWitnessDetails.tsx" />)}
51
51
  <TransactionBoundWitnessCard elevation={4} wrapper={wrapper} />
52
52
  <PayloadTableFlexbox
53
+ eventNoun="payload"
54
+ clickableFields={['hash']}
53
55
  tooltip="Payloads included in the transaction that are elevated and validated."
54
56
  IconComponent={<VscSymbolNamespace />}
55
57
  hashes={elevatedPayloadHashes}
@@ -59,6 +61,8 @@ export const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDet
59
61
  />
60
62
  {(publicPayloadHashes?.length ?? 0) > 0 && (
61
63
  <PayloadTableFlexbox
64
+ eventNoun="payload"
65
+ clickableFields={['hash']}
62
66
  tooltip="Public payloads included in the transaction."
63
67
  IconComponent={<VscSymbolNamespace />}
64
68
  hashes={publicPayloadHashes}
@@ -69,6 +73,7 @@ export const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDet
69
73
  )}
70
74
  {(referencedPayloadHashes?.length ?? 0) > 0 && (
71
75
  <PayloadTableFlexbox
76
+ // TODO - bring back once the hashes can be searched via datalake
72
77
  tooltip="Payload hashes referenced by the transaction but not included."
73
78
  IconComponent={<VscSymbolNamespace />}
74
79
  clickableFields={nonClickableFields}
package/typedoc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["src/index.ts"],
4
- "tsconfig": "./tsconfig.typedoc.json"
5
- }
package/xy.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
- const config: XyTsupConfig = {
3
- compile: {
4
- browser: { src: true },
5
- node: {},
6
- neutral: {},
7
- },
8
- }
9
-
10
- export default config