Skip to content

Commit

Permalink
remove evm signer from getSourceData
Browse files Browse the repository at this point in the history
  • Loading branch information
Rihyx committed May 28, 2024
1 parent c6331e4 commit 9f2fbb8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
6 changes: 1 addition & 5 deletions packages/sdk/src/getTransferData/getDestinationData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ import { TransferConfig } from '@moonbeam-network/xcm-config';
import { AssetAmount } from '@moonbeam-network/xcm-types';
import { toBigInt } from '@moonbeam-network/xcm-utils';
import { PolkadotService } from '../polkadot';
import { DestinationChainTransferData, EvmSigner } from '../sdk.interfaces';
import { DestinationChainTransferData } from '../sdk.interfaces';
import { getBalance, getDecimals, getMin } from './getTransferData.utils';

export interface GetDestinationDataParams {
transferConfig: TransferConfig;
destinationAddress: string;
evmSigner?: EvmSigner;
polkadot: PolkadotService;
}

export async function getDestinationData({
transferConfig,
destinationAddress,
evmSigner,
polkadot,
}: GetDestinationDataParams): Promise<DestinationChainTransferData> {
const {
Expand Down Expand Up @@ -50,7 +48,6 @@ export async function getDestinationData({
const feeAmount = await getFee({
address: destinationAddress,
config: transferConfig,
evmSigner,
polkadot,
});
const minAmount = zeroAmount.copyWith({ amount: min });
Expand All @@ -66,7 +63,6 @@ export async function getDestinationData({
export interface GetFeeParams {
address: string;
config: TransferConfig;
evmSigner?: EvmSigner;
polkadot: PolkadotService;
}

Expand Down
6 changes: 0 additions & 6 deletions packages/sdk/src/getTransferData/getSourceData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export async function getSourceData({
transferConfig,
destinationAddress,
destinationFee,
evmSigner,
polkadot,
sourceAddress,
}: GetSourceDataParams): Promise<SourceChainTransferData> {
Expand All @@ -55,7 +54,6 @@ export async function getSourceData({
address: destinationAddress,
chain,
config,
evmSigner,
polkadot,
}),
});
Expand All @@ -67,7 +65,6 @@ export async function getSourceData({
asset: config.fee.asset,
chain,
config,
evmSigner,
polkadot,
}),
})
Expand All @@ -80,7 +77,6 @@ export async function getSourceData({
asset: config.destinationFee.asset,
chain,
config,
evmSigner,
polkadot,
}),
})
Expand All @@ -91,7 +87,6 @@ export async function getSourceData({
chain,
config,
decimals: zeroAmount.decimals,
evmSigner,
polkadot,
});

Expand Down Expand Up @@ -150,7 +145,6 @@ export async function getSourceData({
decimals: zeroFeeAmount.decimals,
destinationFeeBalanceAmount,
destinationFeeConfig: config.destinationFee,
evmSigner,
extrinsic,
feeConfig: config.fee,
polkadot,
Expand Down
3 changes: 1 addition & 2 deletions packages/sdk/src/getTransferData/getTransferData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface GetTransferDataParams extends Partial<Signers> {
transferConfig: TransferConfig;
}

// TODO: make getTransferData work with EvmSigner and PolkadotSigner
export async function getTransferData({
configService,
destinationAddress,
Expand All @@ -36,7 +37,6 @@ export async function getTransferData({

const destination = await getDestinationData({
destinationAddress,
evmSigner,
polkadot: destPolkadot,
transferConfig,
});
Expand All @@ -49,7 +49,6 @@ export async function getTransferData({
const source = await getSourceData({
destinationAddress,
destinationFee,
evmSigner,
polkadot: srcPolkadot,
sourceAddress,
transferConfig,
Expand Down
2 changes: 0 additions & 2 deletions packages/sdk/src/getTransferData/getTransferData.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import {
createContractWithoutSigner,
} from '../contract';
import { PolkadotService } from '../polkadot';
import { EvmSigner } from '../sdk.interfaces';

export interface GetBalancesParams {
address: string;
asset?: Asset;
chain: AnyChain;
config: AssetConfig;
decimals: number;
evmSigner?: EvmSigner;
polkadot: PolkadotService;
}

Expand Down

0 comments on commit 9f2fbb8

Please sign in to comment.