@stellar-expert/ui-framework 1.16.7 → 1.17.0

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.
Files changed (92) hide show
  1. package/CLAUDE.md +35 -0
  2. package/README.md +1125 -3
  3. package/account/account-address.js +127 -127
  4. package/account/available-balance.js +22 -22
  5. package/account/identicon.js +90 -90
  6. package/account/signer-key.js +65 -64
  7. package/api/explorer-api-hooks.js +209 -202
  8. package/api/explorer-api-paginated-list-hooks.js +441 -440
  9. package/api/explorer-batch-info-loader.js +111 -85
  10. package/api/explorer-tx-api.js +28 -28
  11. package/api/ledger-stream.js +15 -0
  12. package/asset/amount.js +56 -56
  13. package/asset/asset-icon.js +41 -41
  14. package/asset/asset-issuer.js +21 -21
  15. package/asset/asset-link.js +107 -107
  16. package/asset/asset-list-hooks.js +59 -59
  17. package/asset/asset-meta-hooks.js +88 -88
  18. package/asset/asset-selector.js +72 -71
  19. package/basic-styles/base.scss +50 -50
  20. package/basic-styles/grid.scss +1 -1
  21. package/basic-styles/table.scss +1 -1
  22. package/claimable-balance/claimable-balance-claimants.js +5 -0
  23. package/contract/contract-api.js +15 -0
  24. package/contract/invocation-info-view.js +10 -2
  25. package/contract/sc-val.js +24 -0
  26. package/controls/button-group.js +25 -19
  27. package/controls/button-group.scss +46 -46
  28. package/controls/button.js +93 -78
  29. package/controls/button.scss +173 -173
  30. package/controls/code-block.js +42 -34
  31. package/controls/code-block.scss +71 -71
  32. package/controls/dropdown.js +318 -287
  33. package/controls/dropdown.scss +159 -159
  34. package/controls/external-link.js +10 -4
  35. package/controls/info-tooltip.js +23 -16
  36. package/controls/slider.js +29 -19
  37. package/controls/tabs.js +94 -94
  38. package/controls/tabs.scss +70 -70
  39. package/controls/tooltip.js +244 -240
  40. package/controls/tooltip.scss +116 -116
  41. package/controls/update-highlighter.js +32 -27
  42. package/controls/update-highlighter.scss +7 -7
  43. package/date/date-selector.js +56 -54
  44. package/date/elapsed-time.js +28 -21
  45. package/dex/price-dynamic.js +53 -44
  46. package/dex/price-dynamic.scss +33 -33
  47. package/directory/directory-hooks.js +109 -97
  48. package/effect/effect-description.js +5 -3
  49. package/errors/error-boundary.js +110 -97
  50. package/horizon/horizon-account-helpers.js +104 -104
  51. package/horizon/horizon-ledger-helpers.js +35 -35
  52. package/horizon/horizon-trades-helper.js +88 -88
  53. package/horizon/horizon-transaction-helpers.js +36 -36
  54. package/index.d.ts +1241 -0
  55. package/interaction/accordion.js +43 -35
  56. package/interaction/autofocus.js +13 -9
  57. package/interaction/block-select.js +64 -53
  58. package/interaction/block-select.scss +21 -21
  59. package/interaction/copy-to-clipboard.js +25 -18
  60. package/interaction/inline-progress.js +20 -15
  61. package/interaction/qr-code.js +34 -34
  62. package/interaction/responsive.js +20 -20
  63. package/interaction/spoiler.js +52 -39
  64. package/interaction/spoiler.scss +6 -6
  65. package/interaction/theme-selector.js +13 -10
  66. package/ledger/ledger-entry-href-formatter.js +4 -3
  67. package/ledger/ledger-entry-link.js +93 -58
  68. package/ledger/ledger-info-parser.js +28 -0
  69. package/meta/page-meta-tags.js +243 -238
  70. package/module/dynamic-module.js +47 -47
  71. package/package.json +3 -2
  72. package/state/on-screen-hooks.js +22 -22
  73. package/state/page-visibility-helpers.js +29 -16
  74. package/state/page-visibility-hooks.js +13 -11
  75. package/state/screen-orientation-hooks.js +19 -15
  76. package/state/state-hooks.js +76 -76
  77. package/state/stellar-network-hooks.js +56 -44
  78. package/state/theme.js +29 -28
  79. package/stellar/key-type.js +92 -91
  80. package/stellar/ledger-generic-id.js +39 -39
  81. package/stellar/signature-hint-utils.js +65 -65
  82. package/toast/toast-notifications-block.js +59 -59
  83. package/toast/toast-notifications.scss +1 -1
  84. package/tx/op-description-view.js +84 -81
  85. package/tx/op-icon.js +98 -98
  86. package/tx/parser/op-balance-changes.js +66 -66
  87. package/tx/parser/op-descriptor.js +51 -48
  88. package/tx/parser/tx-details-parser.js +81 -81
  89. package/tx/parser/tx-matcher.js +371 -371
  90. package/tx/parser/type-filter-matcher.js +126 -126
  91. package/tx/tx-list-hooks.js +32 -18
  92. package/tx/tx-operations-list.js +117 -116
@@ -1,59 +1,94 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
- import {formatExplorerLink} from './ledger-entry-href-formatter'
4
- import {useStellarNetwork} from '../state/stellar-network-hooks'
5
-
6
- function LedgerEntryLink({type, id, network, children}) {
7
- const globallySetNetwork = useStellarNetwork()
8
- return <a href={formatExplorerLink(type, id, network || globallySetNetwork)} target="_blank">{children || id}</a>
9
- }
10
-
11
- export const TxLink = React.memo(function TxLink({tx, network, children}) {
12
- return React.createElement(LedgerEntryLink, {type: 'tx', id: tx, network, children})
13
- })
14
-
15
- TxLink.propTypes = {
16
- tx: PropTypes.string.isRequired,
17
- network: PropTypes.string,
18
- children: PropTypes.any
19
- }
20
-
21
- export const OpLink = React.memo(function OpLink({op, network, children}) {
22
- return React.createElement(LedgerEntryLink, {type: 'op', id: op, network, children})
23
- })
24
-
25
- OpLink.propTypes = {
26
- op: PropTypes.string.isRequired,
27
- network: PropTypes.string,
28
- children: PropTypes.any
29
- }
30
-
31
- export const LedgerLink = React.memo(function LedgerLink({sequence, network, children}) {
32
- return React.createElement(LedgerEntryLink, {type: 'ledger', id: sequence, network, children})
33
- })
34
-
35
- LedgerLink.propTypes = {
36
- sequence: PropTypes.number.isRequired,
37
- network: PropTypes.string,
38
- children: PropTypes.any
39
- }
40
-
41
- export const OfferLink = React.memo(function OfferLink({offer, network, children}) {
42
- return React.createElement(LedgerEntryLink, {type: 'offer', id: offer, network, children})
43
- })
44
-
45
- OfferLink.propTypes = {
46
- offer: PropTypes.string.isRequired,
47
- network: PropTypes.string,
48
- children: PropTypes.any
49
- }
50
-
51
- export const PoolLink = React.memo(function PoolLink({pool, network, children}) {
52
- return React.createElement(LedgerEntryLink, {type: 'pool', id: pool, network, children})
53
- })
54
-
55
- PoolLink.propTypes = {
56
- pool: PropTypes.string.isRequired,
57
- network: PropTypes.string,
58
- children: PropTypes.any
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import {formatExplorerLink} from './ledger-entry-href-formatter'
4
+ import {useStellarNetwork} from '../state/stellar-network-hooks'
5
+
6
+ function LedgerEntryLink({type, id, network, children}) {
7
+ const globallySetNetwork = useStellarNetwork()
8
+ return <a href={formatExplorerLink(type, id, network || globallySetNetwork)} target="_blank">{children || id}</a>
9
+ }
10
+
11
+ /**
12
+ * Link to a transaction on StellarExpert
13
+ * @param {Object} props
14
+ * @param {string} props.tx - Transaction hash
15
+ * @param {string} [props.network] - Stellar network override
16
+ * @param {*} [props.children] - Custom link content (defaults to the tx hash)
17
+ */
18
+ export const TxLink = React.memo(function TxLink({tx, network, children}) {
19
+ return React.createElement(LedgerEntryLink, {type: 'tx', id: tx, network, children})
20
+ })
21
+
22
+ TxLink.propTypes = {
23
+ tx: PropTypes.string.isRequired,
24
+ network: PropTypes.string,
25
+ children: PropTypes.any
26
+ }
27
+
28
+ /**
29
+ * Link to an operation on StellarExpert
30
+ * @param {Object} props
31
+ * @param {string} props.op - Operation ID
32
+ * @param {string} [props.network] - Stellar network override
33
+ * @param {*} [props.children] - Custom link content
34
+ */
35
+ export const OpLink = React.memo(function OpLink({op, network, children}) {
36
+ return React.createElement(LedgerEntryLink, {type: 'op', id: op, network, children})
37
+ })
38
+
39
+ OpLink.propTypes = {
40
+ op: PropTypes.string.isRequired,
41
+ network: PropTypes.string,
42
+ children: PropTypes.any
43
+ }
44
+
45
+ /**
46
+ * Link to a ledger on StellarExpert
47
+ * @param {Object} props
48
+ * @param {number} props.sequence - Ledger sequence number
49
+ * @param {string} [props.network] - Stellar network override
50
+ * @param {*} [props.children] - Custom link content
51
+ */
52
+ export const LedgerLink = React.memo(function LedgerLink({sequence, network, children}) {
53
+ return React.createElement(LedgerEntryLink, {type: 'ledger', id: sequence, network, children})
54
+ })
55
+
56
+ LedgerLink.propTypes = {
57
+ sequence: PropTypes.number.isRequired,
58
+ network: PropTypes.string,
59
+ children: PropTypes.any
60
+ }
61
+
62
+ /**
63
+ * Link to a DEX offer on StellarExpert
64
+ * @param {Object} props
65
+ * @param {string} props.offer - Offer ID
66
+ * @param {string} [props.network] - Stellar network override
67
+ * @param {*} [props.children] - Custom link content
68
+ */
69
+ export const OfferLink = React.memo(function OfferLink({offer, network, children}) {
70
+ return React.createElement(LedgerEntryLink, {type: 'offer', id: offer, network, children})
71
+ })
72
+
73
+ OfferLink.propTypes = {
74
+ offer: PropTypes.string.isRequired,
75
+ network: PropTypes.string,
76
+ children: PropTypes.any
77
+ }
78
+
79
+ /**
80
+ * Link to a liquidity pool on StellarExpert
81
+ * @param {Object} props
82
+ * @param {string} props.pool - Pool ID
83
+ * @param {string} [props.network] - Stellar network override
84
+ * @param {*} [props.children] - Custom link content
85
+ */
86
+ export const PoolLink = React.memo(function PoolLink({pool, network, children}) {
87
+ return React.createElement(LedgerEntryLink, {type: 'pool', id: pool, network, children})
88
+ })
89
+
90
+ PoolLink.propTypes = {
91
+ pool: PropTypes.string.isRequired,
92
+ network: PropTypes.string,
93
+ children: PropTypes.any
59
94
  }
@@ -1,5 +1,33 @@
1
1
  import {xdr} from '@stellar/stellar-base'
2
2
 
3
+ /**
4
+ * @typedef {Object} LedgerInfo
5
+ * @property {number} sequence - Ledger sequence number
6
+ * @property {number} ts - Ledger close timestamp
7
+ * @property {number} protocol - Protocol version
8
+ * @property {number} operations - number of successful operations
9
+ * @property {number} failedOperations - number of failed operations
10
+ * @property {number} txSuccess - number of successful transactions
11
+ * @property {number} txFailed - number of failed transactions
12
+ * @property {bigint} xlm - Total lumens in circulation
13
+ * @property {bigint} feePool - Fee pool amount
14
+ * @property {number} baseFee - Base fee in stroops
15
+ * @property {number} baseReserve - Base reserve in stroops
16
+ */
17
+
18
+ /**
19
+ * Parse raw ledger data including XDR header into structured ledger info
20
+ * @param {Object} data - Raw ledger data from the API
21
+ * @param {string} data.xdr - Base64-encoded XDR ledger header
22
+ * @param {number} data.sequence - Ledger sequence number
23
+ * @param {number} data.ts - Ledger close timestamp
24
+ * @param {number} data.protocol - Protocol version
25
+ * @param {number} [data.successful_operations] - Successful operation count
26
+ * @param {number} [data.failed_operations] - Failed operation count
27
+ * @param {number} [data.successful_transactions] - Successful transaction count
28
+ * @param {number} [data.failed_transactions] - Failed transaction count
29
+ * @return {LedgerInfo}
30
+ */
3
31
  export function retrieveLedgerInfo(data) {
4
32
  const parsed = xdr.LedgerHeader.fromXDR(data.xdr, 'base64')
5
33
  return {