@stellar-expert/ui-framework 1.15.0-rc.8 → 1.15.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.
@@ -52,6 +52,8 @@ export const ScVal = React.memo(function ScVal({value, nested = false, indent =
52
52
  return <AccountAddress account={xdrParserUtils.xdrParseAccountAddress(val.value())}/>
53
53
  case 'contractId':
54
54
  return <AccountAddress account={xdrParserUtils.xdrParseContractAddress(val.value())}/>
55
+ case 'muxedAccount':
56
+ return <AccountAddress account={xdrParserUtils.xdrParseMuxedScAddress(val.value())}/>
55
57
  }
56
58
  return <span className="dimmed">(unsupported address)</span>
57
59
  case 'bytes':
@@ -10,6 +10,7 @@ import {AssetLink} from '../asset/asset-link'
10
10
  import {Amount} from '../asset/amount'
11
11
  import {CopyToClipboard} from '../interaction/copy-to-clipboard'
12
12
  import {ScVal} from '../contract/sc-val'
13
+ import {InfoTooltip} from '../controls/info-tooltip'
13
14
  import InvocationInfoView from '../contract/invocation-info-view'
14
15
 
15
16
  /**
@@ -107,12 +108,12 @@ export function EffectDescription({effect, operation}) {
107
108
  case 'claimableBalanceCreated':
108
109
  return <>
109
110
  Account <AccountAddress account={effect.source}/> created claimable
110
- balance {shortenString(effect.balance)} <Amount asset={effect.asset} amount={effect.amount} adjust/>
111
+ balance <ClaimableBalance effect={effect}/> <Amount asset={effect.asset} amount={effect.amount} adjust/>
111
112
  </>
112
113
  case 'claimableBalanceRemoved':
113
114
  return <>
114
115
  Account <AccountAddress account={effect.source}/> claimed claimable
115
- balance {shortenString(effect.balance)} <Amount asset={effect.asset} amount={effect.amount} adjust/>
116
+ balance <ClaimableBalance effect={effect}/> <Amount asset={effect.asset} amount={effect.amount} adjust/>
116
117
  </>
117
118
  case 'accountSponsorshipCreated':
118
119
  case 'accountSponsorshipUpdated':
@@ -161,12 +162,13 @@ export function EffectDescription({effect, operation}) {
161
162
  case 'claimableBalanceSponsorshipCreated':
162
163
  case 'claimableBalanceSponsorshipUpdated':
163
164
  return <>
164
- Account <AccountAddress account={effect.sponsor}/> sponsored claimable balance {shortenString(effect.balance)}
165
+ Account <AccountAddress account={effect.sponsor}/> sponsored claimable balance <ClaimableBalance effect={effect}/>
165
166
  {effect.source !== effect.sponsor && <> for account <AccountAddress account={effect.source}/></>}
166
167
  </>
167
168
  case 'claimableBalanceSponsorshipRemoved':
168
169
  return <>
169
- Account <AccountAddress account={effect.prevSponsor}/> revoked claimable balance {shortenString(effect.balance)} sponsorship
170
+ Account <AccountAddress account={effect.prevSponsor}/> revoked claimable
171
+ balance <ClaimableBalance effect={effect}/> sponsorship
170
172
  {effect.source !== effect.prevSponsor && <> for account <AccountAddress account={effect.source}/></>}
171
173
  </>
172
174
  case 'signerSponsorshipCreated':
@@ -212,11 +214,14 @@ export function EffectDescription({effect, operation}) {
212
214
  case 'inflation':
213
215
  return <>Inflation distribution initialized</>
214
216
  case 'contractCodeUploaded':
215
- return <>Contract code <LedgerKeyHint effect={effect}><ContractCodeWasm wasm={effect.wasm}/></LedgerKeyHint> uploaded</>
217
+ case 'contractCodeRestored':
218
+ return <>Contract code {getEffectAction(effect, 'contractCode')}
219
+ <LedgerKeyHint effect={effect}><ContractCodeWasm wasm={effect.wasm || effect.wasmHash}/></LedgerKeyHint></>
216
220
  case 'contractCreated':
217
- return <>Contract <AccountAddress account={effect.contract}/> created <ContractDetails effect={effect}/></>
218
221
  case 'contractUpdated':
219
- return <>Contract <AccountAddress account={effect.contract}/> updated <ContractDetails effect={effect}/></>
222
+ case 'contractRestored':
223
+ return <>Contract <AccountAddress account={effect.contract}/> {getEffectAction(effect, 'contract')}
224
+ <ContractDetails effect={effect}/><ConstructorDetails/></>
220
225
  case 'contractInvoked':
221
226
  return <>{effect.depth > 0 &&
222
227
  <i className="icon-level-down text-tiny color-primary" style={{paddingLeft: (effect.depth - 1) + 'em'}}/>}
@@ -228,9 +233,10 @@ export function EffectDescription({effect, operation}) {
228
233
  with data <ScVal value={effect.rawData}/></>
229
234
  case 'contractDataCreated':
230
235
  case 'contractDataUpdated':
231
- return <>Contract <AccountAddress account={effect.owner}/>
232
- {effect.type === 'contractDataCreated' ? ' created ' : ' updated '} {effect.durability} data{' '}
233
- <LedgerKeyHint effect={effect}><ScVal value={effect.key}/></LedgerKeyHint> with value <ScVal value={effect.value}/>
236
+ case 'contractDataRestored':
237
+ return <>Contract <AccountAddress account={effect.owner}/> {getEffectAction(effect, 'contractData')}
238
+ {effect.durability} data{' '}
239
+ <LedgerKeyHint effect={effect}><ScVal value={effect.key}/></LedgerKeyHint> = <ScVal value={effect.value}/>
234
240
  </>
235
241
  case 'contractDataRemoved':
236
242
  return <>Contract <AccountAddress account={effect.owner}/> removed {effect.durability}{' '}
@@ -322,12 +328,25 @@ function ContractCodeWasm({wasm}) {
322
328
  </>
323
329
  }
324
330
 
331
+ function ClaimableBalance(effect) {
332
+ const {balance} = effect
333
+ return <>
334
+ {shortenString(balance)} <CopyToClipboard text={wasmHash}/>{/*<InfoTooltip icon="icon-plus">
335
+ <CopyToClipboard text={balance}>{balance}</CopyToClipboard>
336
+ </InfoTooltip>*/}
337
+ </>
338
+ }
339
+
325
340
  function LedgerKeyHint({effect, children}) {
326
341
  if (!effect.keyHash)
327
342
  return children
328
343
  return <span title={'Ledger key ' + effect.keyHash}>{children}</span>
329
344
  }
330
345
 
346
+ function getEffectAction(effect, prefix) {
347
+ return effect.type.replace(prefix, '').toLowerCase() + ' '
348
+ }
349
+
331
350
  const ledgerEntryKind = {
332
351
  contractData: 'contract state entry',
333
352
  contractCode: 'contract code WASM'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-expert/ui-framework",
3
- "version": "1.15.0-rc.8",
3
+ "version": "1.15.0",
4
4
  "description": "StellarExpert shared UI components library",
5
5
  "main": "index.js",
6
6
  "module": "./index.js",
@@ -22,7 +22,7 @@
22
22
  "@stellar-expert/contract-wasm-interface-parser": "^3.2.0",
23
23
  "@stellar-expert/formatter": "^2.5.0",
24
24
  "@stellar-expert/navigation": "github:stellar-expert/navigation#v1.0.2",
25
- "@stellar-expert/tx-meta-effects-parser": "7.0.0-rc.6",
25
+ "@stellar-expert/tx-meta-effects-parser": "7.0.0-rc.17",
26
26
  "classnames": ">=2",
27
27
  "prop-types": ">=15",
28
28
  "qrcode.react": "^4.2.0",