@xyo-network/react-chain-boundwitness 1.7.6 → 1.7.8
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.
- package/README.md +8521 -3
- package/dist/browser/components/PayloadTable.d.ts +3 -3
- package/dist/browser/components/PayloadTable.d.ts.map +1 -1
- package/dist/browser/components/block/BlockBoundWitnessDetails.d.ts.map +1 -1
- package/dist/browser/components/transactions/TransactionBoundWitnessDetails.d.ts.map +1 -1
- package/dist/browser/components/transactions/TransactionBoundWitnessDetails.stories.d.ts +2 -1
- package/dist/browser/components/transactions/TransactionBoundWitnessDetails.stories.d.ts.map +1 -1
- package/dist/browser/index.mjs +17 -7
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +27 -27
- package/src/components/PayloadTable.tsx +4 -6
- package/src/components/block/BlockBoundWitnessDetails.tsx +4 -3
- package/src/components/transactions/TransactionBoundWitnessDetails.stories.tsx +14 -1
- package/src/components/transactions/TransactionBoundWitnessDetails.tsx +6 -1
|
@@ -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}
|