Skip to content

Commit

Permalink
refactor: update imports and simplify getFeeAssetLocation function
Browse files Browse the repository at this point in the history
  • Loading branch information
ap211unitech committed Jan 30, 2025
1 parent a34a4f1 commit 852fbda
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/react-hooks/src/useAssetIds.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2017-2025 @polkadot/react-hooks authors & contributors
// SPDX-License-Identifier: Apache-2.0

import type { Changes } from '@polkadot/react-hooks/useEventChanges';
import type { StorageKey, u32 } from '@polkadot/types';
import type { EventRecord } from '@polkadot/types/interfaces';
import type { Changes } from './useEventChanges.js';

import { createNamedHook, useApi, useEventChanges, useMapKeys } from '@polkadot/react-hooks';
import { createNamedHook, useApi, useEventChanges, useMapKeys } from './index.js';

const EMPTY_PARAMS: unknown[] = [];

Expand Down
14 changes: 4 additions & 10 deletions packages/react-hooks/src/utils/getFeeAssetLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@ export const getFeeAssetLocation = (api: ApiPromise, feeAsset: AssetInfoComplete

switch (genesis) {
case CHAINS_WITH_FEE_ASSET[0]: {
const palletInstance = { PalletInstance: 50 };
const generalIndex = { GeneralIndex: feeAsset.id };

return {
interior: {
X2: [
{
PalletInstance: 50
},
{
GeneralIndex: feeAsset.id.toString()
}
]
},
interior: { X2: [palletInstance, generalIndex] },
parents: 0
};
}
Expand Down
2 changes: 0 additions & 2 deletions packages/react-signer/src/TxSigned.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ async function signAndSend (queueSetTxStatus: QueueTxMessageSetStatus, currentIt
await fakeSignForChopsticks(api, tx, pairOrAddress as string);
}

console.info('sending', tx.toHex());

queueSetTxStatus(currentItem.id, 'sending');

const unsubscribe = await tx.send(handleTxResults('signAndSend', queueSetTxStatus, currentItem, (): void => {
Expand Down

0 comments on commit 852fbda

Please sign in to comment.