Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Sep 6, 2023
1 parent 025c15a commit f620e23
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
8 changes: 2 additions & 6 deletions src/pages/transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import {
import { ApiPromise, Keyring, WsProvider } from '@polkadot/api';
import { useInkathon } from '@scio-labs/use-inkathon';
import styles from '@styles/pages/transfer.module.scss';
import { getChains, getTokens } from 'chaindata';
import { useCallback, useEffect, useState } from 'react';
import { AccountType } from 'types/types-arguments/identity';

import AssetRegistry, { Asset } from '@/utils/assetRegistry';
import IdentityKey from '@/utils/identityKey';
import KeyStore from '@/utils/keyStore';
import NativeTransfer from '@/utils/nativeTransfer';
import TransactionRouter, { isTeleport } from '@/utils/xcmTransfer';
import { getTeleportableAssets } from '@/utils/xcmTransfer/teleportableRoutes';
import { Fungible } from '@/utils/xcmTransfer/types';
Expand All @@ -28,8 +30,6 @@ import { useRelayApi } from '@/contexts/RelayApi';
import { useToast } from '@/contexts/Toast';
import { useIdentity } from '@/contracts';
import { useAddressBook } from '@/contracts/addressbook/context';
import { getChains, getTokens } from 'chaindata';
import NativeTransfer from '@/utils/nativeTransfer';

const TransferPage = () => {
const {
Expand Down Expand Up @@ -104,13 +104,10 @@ const TransferPage = () => {

const _assets = [];
if (chainData) {
console.log(chainData.id);
const tokens = (await getTokens()).filter((token) => {
const isPartOfSourceChain = token.data.id.startsWith(chainData.id);
console.log(isPartOfSourceChain);
return isPartOfSourceChain;
});
console.log(tokens);
const assets: Asset[] = tokens.map(t => {
const asset: Asset = {
asset: "",
Expand All @@ -123,7 +120,6 @@ const TransferPage = () => {
};
return asset;
});
console.log(assets);
_assets.push(...assets);
}

Expand Down
3 changes: 2 additions & 1 deletion src/utils/nativeTransfer/assets.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ApiPromise } from "@polkadot/api";
import { AccountIdRaw } from "../xcmTransfer/types";
import { Signer } from "@polkadot/api/types";
import { KeyringPair } from "@polkadot/keyring/types";

import { AccountIdRaw } from "../xcmTransfer/types";

class SubstrateAssets {
public static async transfer(
api: ApiPromise,
Expand Down
7 changes: 4 additions & 3 deletions src/utils/nativeTransfer/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ApiPromise } from "@polkadot/api";
import { AccountIdRaw } from "../xcmTransfer/types";
import SubstrateAssets from "./assets";
import { Signer } from "@polkadot/api/types";
import { KeyringPair } from "@polkadot/keyring/types";

import SubstrateAssets from "./assets";
import SubstrateNative from "./native";
import SubstrateTokens from "./tokens";
import SubstrateOrml from "./orml";
import SubstrateTokens from "./tokens";
import { AccountIdRaw } from "../xcmTransfer/types";

class NativeTransfer {
public static async transfer(
Expand Down
3 changes: 2 additions & 1 deletion src/utils/nativeTransfer/native.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ApiPromise } from "@polkadot/api";
import { Signer } from "@polkadot/api/types";
import { KeyringPair } from "@polkadot/keyring/types";

import { AccountIdRaw } from "../xcmTransfer/types";
import { Signer } from "@polkadot/api/types";

class SubstrateNative {
public static async transfer(
Expand Down
3 changes: 2 additions & 1 deletion src/utils/nativeTransfer/orml.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ApiPromise } from "@polkadot/api";
import { AccountIdRaw } from "../xcmTransfer/types";
import { Signer } from "@polkadot/api/types";
import { KeyringPair } from "@polkadot/keyring/types";

import { AccountIdRaw } from "../xcmTransfer/types";

class SubstrateOrml {
public static async transfer(
api: ApiPromise,
Expand Down
3 changes: 2 additions & 1 deletion src/utils/nativeTransfer/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ApiPromise } from "@polkadot/api";
import { AccountIdRaw } from "../xcmTransfer/types";
import { Signer } from "@polkadot/api/types";
import { KeyringPair } from "@polkadot/keyring/types";

import { AccountIdRaw } from "../xcmTransfer/types";

class SubstrateTokens {
public static async transfer(
api: ApiPromise,
Expand Down

0 comments on commit f620e23

Please sign in to comment.