Skip to content

Commit

Permalink
Merge pull request #1336 from Polkadex-Substrate/fix/cross-chain-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nuel77 committed Jul 4, 2024
2 parents ffe8ff1 + 5bef5eb commit fe260dc
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 60 deletions.
2 changes: 1 addition & 1 deletion apps/hestia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@polkadex/numericals": "^0.4.0",
"@polkadex/polkadex-api": "^3.6.2",
"@polkadex/subscan": "^1.1.61",
"@polkadex/thea": "^5.9.0",
"@polkadex/thea": "^6.1.1",
"@polkadex/ux": "^6.26.0",
"@polkadex/react-providers": "^2.2.1",
"@polkadex/types": "^1.2.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@polkadex/local-wallets": "^2.2.0",
"@polkadex/polkadex-api": "^3.6.2",
"@polkadex/react-providers": "^2.2.1",
"@polkadex/thea": "^5.9.0",
"@polkadex/thea": "^6.1.1",
"@polkadex/utils": "^0.2.1",
"@polkadot-cloud/assets": "^0.3.0",
"@polkadot/api": "^10.12.6",
Expand Down Expand Up @@ -91,7 +91,7 @@
"@next/eslint-plugin-next": "^14.2.1",
"@orderbook/eslint-config": "*",
"@orderbook/tsconfig": "*",
"@polkadot/types": "^10.11.2",
"@polkadot/types": "^10.12.6",
"@types/d3-array": "^3.0.7",
"@types/file-saver": "^2.0.5",
"@types/jest": "^29.5.5",
Expand Down
19 changes: 11 additions & 8 deletions packages/core/src/hooks/useAssetTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ExtensionAccount,
useTransactionManager,
} from "@polkadex/react-providers";
import { SubmittableExtrinsic } from "@polkadot/api/promise/types";

import { useSettingsProvider } from "../providers/public/settings";
import { appsyncOrderbookService } from "../utils/orderbookService";
Expand Down Expand Up @@ -42,14 +43,16 @@ export const useAssetTransfer = (onRefetch: () => Promise<void>) => {
.multipliedBy(UNIT_BN)
.toString();

const signedExtrinsic = await appsyncOrderbookService.operation.transfer({
api,
account,
asset,
amount: amountFormatted,
dest,
tokenFeeId,
});
const signedExtrinsic = (await appsyncOrderbookService.operation.transfer(
{
api,
account,
asset,
amount: amountFormatted,
dest,
tokenFeeId,
}
)) as SubmittableExtrinsic;
addToTxQueue(signedExtrinsic);
await handleTransaction(signedExtrinsic);

Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/hooks/useDeposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ExtensionAccount,
useTransactionManager,
} from "@polkadex/react-providers";
import { SubmittableExtrinsic } from "@polkadot/api/promise/types";

import { useSettingsProvider } from "../providers/public/settings";
import { useNativeApi } from "../providers/public/nativeApi";
Expand Down Expand Up @@ -35,13 +36,13 @@ export const useDeposit = () => {

onHandleInfo?.("Processing Deposit...");

const signedExtrinsic = await appsyncOrderbookService.operation.deposit({
const signedExtrinsic = (await appsyncOrderbookService.operation.deposit({
api,
account,
asset,
amount,
tokenFeeId,
});
})) as SubmittableExtrinsic;
addToTxQueue(signedExtrinsic);
await handleTransaction(signedExtrinsic);
},
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/hooks/useRemoveProxyAcccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useMutation } from "@tanstack/react-query";
import { handleTransaction, removeFromStorage } from "@orderbook/core/helpers";
import { ACTIVE_ACCOUNT_KEY } from "@orderbook/core/providers/user/profile/constants";
import { KeyringPair } from "@polkadot/keyring/types";
import { SubmittableExtrinsic } from "@polkadot/api/promise/types";

import { appsyncOrderbookService } from "../utils/orderbookService";
import { NOTIFICATIONS } from "../constants";
Expand Down Expand Up @@ -49,12 +50,12 @@ export function useRemoveProxyAccount({
if (!selectedWallet) throw new Error("seletedWallet is not defined");

const signedExtrinsic =
await appsyncOrderbookService.operation.removeAccount({
(await appsyncOrderbookService.operation.removeAccount({
api,
account: selectedWallet,
proxyAddress: proxy,
tokenFeeId,
});
})) as SubmittableExtrinsic;
addToTxQueue(signedExtrinsic);
await handleTransaction(signedExtrinsic);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class AppsyncV1Operations implements OrderbookOperationStrategy {
// assetId,
});

return signedExt;
return signedExt as SubmittableExtrinsic;
}

async claimReward({
Expand Down
Loading

0 comments on commit fe260dc

Please sign in to comment.