Skip to content

Commit

Permalink
chore: update packages and fix foreign assets problem (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMIRKHANEF authored Nov 25, 2024
1 parent a3a539b commit ce4c6f9
Show file tree
Hide file tree
Showing 5 changed files with 2,849 additions and 2,310 deletions.
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@
"@mui/icons-material": "^5.15.18",
"@mui/lab": "^5.0.0-alpha.85",
"@mui/material": "^5.8.3",
"@polkadot/api": "^11.2.1",
"@polkadot/api-augment": "^11.2.1",
"@polkadot/api-base": "^11.2.1",
"@polkadot/api-contract": "^11.2.1",
"@polkadot/api-derive": "^11.2.1",
"@polkadot/rpc-augment": "^11.2.1",
"@polkadot/rpc-core": "^11.2.1",
"@polkadot/rpc-provider": "^11.2.1",
"@polkadot/types": "^11.2.1",
"@polkadot/types-codec": "^11.2.1",
"@polkadot/types-known": "^11.2.1",
"@polkadot/types-support": "^11.2.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/api": "^14.3.1",
"@polkadot/api-augment": "^14.3.1",
"@polkadot/api-base": "^14.3.1",
"@polkadot/api-contract": "^14.3.1",
"@polkadot/api-derive": "^14.3.1",
"@polkadot/rpc-augment": "^14.3.1",
"@polkadot/rpc-core": "^14.3.1",
"@polkadot/rpc-provider": "^14.3.1",
"@polkadot/types": "^14.3.1",
"@polkadot/types-codec": "^14.3.1",
"@polkadot/types-known": "^14.3.1",
"@polkadot/types-support": "^14.3.1",
"@polkadot/util": "^13.2.3",
"@polkadot/util-crypto": "^13.2.3",
"@polkagate/apps-config": "^0.140.7",
"@substrate/connect": "^0.7.32",
"@vaadin/icons": "^23.2.3",
Expand Down Expand Up @@ -117,15 +117,15 @@
"webpack-bundle-analyzer": "^4.9.0"
},
"resolutions": {
"@polkadot/api": "^11.2.1",
"@polkadot/keyring": "^13.1.1",
"@polkadot/networks": "^13.1.1",
"@polkadot/types": "^11.2.1",
"@polkadot/types-augment": "^11.2.1",
"@polkadot/api": "^14.3.1",
"@polkadot/keyring": "^13.2.3",
"@polkadot/networks": "^13.2.3",
"@polkadot/types": "^14.3.1",
"@polkadot/types-augment": "^14.3.1",
"@polkadot/ui-keyring": "^3.6.6",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/x-fetch": "^13.1.1",
"@polkadot/util": "^13.2.3",
"@polkadot/util-crypto": "^13.2.3",
"@polkadot/x-fetch": "^13.2.3",
"babel-core": "^7.0.0-bridge.0",
"safe-buffer": "^5.2.1",
"typescript": "^5.3.3"
Expand Down
9 changes: 3 additions & 6 deletions packages/extension-polkagate/src/components/ShowValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,22 @@
/**
* @description this component is used to show an account balance in some pages like contributeToCrowdloan
* */
import type { BN } from '@polkadot/util';

import { Skeleton } from '@mui/material';
import React from 'react';

export interface Props {
value: number | string | BN | null | undefined;
value: number | string | null | undefined;
height?: number;
unit?: string;
width?: string;
}

export default function ShowValue ({ height = 20, unit, value, width = '90px' }: Props): React.ReactElement<Props> {
export default function ShowValue ({ height = 20, unit = '', value, width = '90px' }: Props): React.ReactElement<Props> {
return (
<>
{value !== undefined
? <>
{value}{' '}{unit}
</>
? <>{value}{' '}{unit}</>
: <Skeleton
animation='wave'
height={height}
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-polkagate/src/fullscreen/stake/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export interface StakingInputs {
pool?: MyPoolInfo,
estimatedFee?: Balance;
selectedValidators?: ValidatorInfo[],
extraInfo?: Record<string, unknown>
extraInfo?: Record<string, any>
}
6 changes: 5 additions & 1 deletion packages/extension-polkagate/src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,18 @@ export const decodeHexValues = (obj: unknown) => {
return obj;
}

const objAsRecord = { ...obj } as Record<string, unknown>;
const objAsRecord = { ...obj } as Record<string, any>;

Object.keys(objAsRecord).forEach((key) => {
if (typeof objAsRecord[key] === 'string' && objAsRecord[key].startsWith('0x')) {
objAsRecord[key] = hexToString(objAsRecord[key]);
}
});

if ('interior' in objAsRecord && 'x1' in objAsRecord['interior']) {
objAsRecord['interior'].x1 = [objAsRecord['interior'].x1];
}

return objAsRecord;
};

Expand Down
Loading

0 comments on commit ce4c6f9

Please sign in to comment.