@@ -73,6 +73,25 @@ export const read: Array<SmartContractReadMethod> = [
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
method_id: '69598efe',
|
||||
name: 'totalPartitions',
|
||||
constant: true,
|
||||
payable: false,
|
||||
outputs: [
|
||||
{
|
||||
type: 'bytes32[]',
|
||||
name: 'bytes32[]',
|
||||
value: [
|
||||
'0x7265736572766564000000000000000000000000000000000000000000000000',
|
||||
'0x6973737565640000000000000000000000000000000000000000000000000000',
|
||||
],
|
||||
},
|
||||
],
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
];
|
||||
|
||||
export const readResultSuccess: SmartContractQueryMethodReadSuccess = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Abi } from 'abitype';
|
||||
|
||||
export type SmartContractMethodArgType = 'address' | 'uint256' | 'bool' | 'string' | 'bytes' | 'bytes32';
|
||||
export type SmartContractMethodArgType = 'address' | 'uint256' | 'bool' | 'string' | 'bytes' | 'bytes32' | 'bytes32[]';
|
||||
export type SmartContractMethodStateMutability = 'view' | 'nonpayable' | 'payable';
|
||||
|
||||
export interface SmartContract {
|
||||
@@ -91,7 +91,7 @@ export interface SmartContractMethodInput {
|
||||
}
|
||||
|
||||
export interface SmartContractMethodOutput extends SmartContractMethodInput {
|
||||
value?: string | boolean;
|
||||
value?: string | boolean | object;
|
||||
}
|
||||
|
||||
export interface SmartContractQueryMethodReadSuccess {
|
||||
|
||||
@@ -9,7 +9,7 @@ import config from 'configs/app';
|
||||
import { WEI } from 'lib/consts';
|
||||
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
|
||||
|
||||
function castValueToString(value: number | string | boolean | bigint | undefined): string {
|
||||
function castValueToString(value: number | string | boolean | object | bigint | undefined): string {
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return value;
|
||||
@@ -21,6 +21,8 @@ function castValueToString(value: number | string | boolean | bigint | undefined
|
||||
return value.toLocaleString(undefined, { useGrouping: false });
|
||||
case 'bigint':
|
||||
return value.toString();
|
||||
case 'object':
|
||||
return JSON.stringify(value, undefined, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +56,7 @@ const ContractMethodStatic = ({ data }: Props) => {
|
||||
);
|
||||
}
|
||||
|
||||
return <chakra.span wordBreak="break-all">({ data.type }): { String(value) }</chakra.span>;
|
||||
return <chakra.span wordBreak="break-all" whiteSpace="pre-wrap">({ data.type }): { String(value) }</chakra.span>;
|
||||
})();
|
||||
|
||||
return (
|
||||
|
||||
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 58 KiB |