diff --git a/packages/ui/src/components/CallInfo.tsx b/packages/ui/src/components/CallInfo.tsx
index 031b5f3c..d44a372e 100644
--- a/packages/ui/src/components/CallInfo.tsx
+++ b/packages/ui/src/components/CallInfo.tsx
@@ -33,6 +33,34 @@ interface CreateTreeParams {
typeName?: string
}
+const handleCallDisplay = ({
+ call,
+ decimals,
+ unit,
+ api,
+ key
+}: {
+ call: any
+ decimals: number
+ unit: string
+ key: string
+ api: ApiPromise
+}) => {
+ const name = `${call.section}.${call.method}`
+ return (
+ <>
+
{name}
+ {createUlTree({
+ name: `${call.section}.${call.method}`,
+ args: call.args,
+ decimals,
+ unit,
+ api
+ })}
+ >
+ )
+}
+
const handleBatchDisplay = ({
value,
decimals,
@@ -46,21 +74,9 @@ const handleBatchDisplay = ({
key: string
api: ApiPromise
}) =>
- value.map((call: any, index: number) => {
- const name = `${call.section}.${call.method}`
- return (
- <>
- {name}
- {createUlTree({
- name: `${call.section}.${call.method}`,
- args: call.args,
- decimals,
- unit,
- api
- })}
- >
- )
- })
+ value.map((call: any, index: number) =>
+ handleCallDisplay({ call, decimals, unit, api, key: `${key}-${index}` })
+ )
const handleBalanceDisplay = ({
value,
@@ -86,10 +102,8 @@ const handleBalanceDisplay = ({
)
}
-const getTypeName = (index: number, name: string, value: any, api: ApiPromise) => {
- const [palletFromName, methodFromName] = name.split('.')
- const pallet = value?.section || palletFromName
- const method = value?.method || methodFromName
+const getTypeName = (index: number, name: string, api: ApiPromise) => {
+ const [pallet, method] = name.split('.')
const metaArgs = !!pallet && !!method && api.tx[pallet][method].meta.args
return (
@@ -101,15 +115,21 @@ const createUlTree = ({ name, args, decimals, unit, api, typeName }: CreateTreeP
if (!args) return
if (!name) return
+ // console.log('args', args)
return (
{Object.entries(args).map(([key, value], index) => {
- const _typeName = typeName || getTypeName(index, name, value, api)
+ const _typeName = typeName || getTypeName(index, name, api)
+ console.log('typename, key, val', _typeName, key, value)
if (_typeName === 'Vec') {
return handleBatchDisplay({ value, decimals, unit, api, key: `${key}-batch` })
}
+ if (_typeName === 'RuntimeCall') {
+ return handleCallDisplay({ call: value, decimals, unit, api, key: `${key}` })
+ }
+
// generically show nice value for Balance type
if (isTypeBalance(_typeName)) {
return handleBalanceDisplay({ value, decimals, unit, key })
@@ -124,8 +144,9 @@ const createUlTree = ({ name, args, decimals, unit, api, typeName }: CreateTreeP
)
}
+ typeof value === 'object' && console.log('calling with typename, args', _typeName, value)
return (
- -
+
-
{key}:{' '}
{typeof value === 'object'
? createUlTree({
diff --git a/packages/ui/src/components/EasySetup/FromCallData.tsx b/packages/ui/src/components/EasySetup/FromCallData.tsx
index 3b11b22d..7aa603ea 100644
--- a/packages/ui/src/components/EasySetup/FromCallData.tsx
+++ b/packages/ui/src/components/EasySetup/FromCallData.tsx
@@ -99,7 +99,7 @@ const FromCallData = ({ className, onSetExtrinsic, isProxySelected, onSetErrorMe