Skip to content

Commit

Permalink
Merge branch 'v3-next' of github.com:moonbeam-foundation/xcm-sdk into…
Browse files Browse the repository at this point in the history
… mjm/snowbridge-assets-v3
  • Loading branch information
mmaurello committed Nov 25, 2024
2 parents 408cb16 + 3700f33 commit a8afc03
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ jobs:
if: always()
id: spell-check
run: pnpm run spell

- name: 🚪 Run Check Exports
run: npm run lint:exports
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"link": "turbo run link",
"lint": "pnpm biome check .",
"lint:fix": "pnpm biome check --write .",
"lint:exports": "ts-unused-exports tsconfig.json --excludePathsFromReport='vitest.workspace.ts;tsup.config.ts;build;examples;vitest.config;src/index.ts' --exitWithCount",
"typecheck": "turbo run typecheck",
"spell": "cspell --quiet -c cspell.config.cjs 'packages/**/src/**'",
"test": "turbo run test",
Expand Down Expand Up @@ -59,6 +60,7 @@
"glob": "^11.0.0",
"lefthook": "^1.7.15",
"syncpack": "^13.0.0",
"ts-unused-exports": "^10.1.0",
"tsup": "^8.3.0",
"turbo": "^2.1.3",
"typescript": "^5.6.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/mrl/src/getTransferData/getMoonChainData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
MoonChainTransferData,
} from '../mrl.interfaces';

export interface GetMoonChainDataParams {
interface GetMoonChainDataParams {
destinationData: DestinationTransferData;
route: MrlAssetRoute;
sourceAddress: string;
Expand Down
16 changes: 8 additions & 8 deletions packages/mrl/src/getTransferData/getSourceData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
getMrlBuilderParams,
} from './getTransferData.utils';

export interface GetSourceDataParams {
interface GetSourceDataParams {
route: MrlAssetRoute;
destinationAddress: string;
destinationFee: AssetAmount;
Expand Down Expand Up @@ -142,7 +142,7 @@ export async function getSourceData({
};
}

export interface GetFeeParams {
interface GetFeeParams {
balance: AssetAmount;
chain: AnyChain;
destinationFee: AssetAmount;
Expand All @@ -152,18 +152,18 @@ export interface GetFeeParams {
transfer: ContractConfig | ExtrinsicConfig | WormholeConfig;
}

export interface GetRelayFeeParams extends BuildTransferParams {
interface GetRelayFeeParams extends BuildTransferParams {
chain: AnyChain;
transfer: ContractConfig | ExtrinsicConfig | WormholeConfig;
}

export interface GetWormholeFeeParams {
interface GetWormholeFeeParams {
asset: AssetAmount;
chain: AnyChain;
config: ContractConfig | ExtrinsicConfig | WormholeConfig;
}

export async function getFee({
async function getFee({
balance,
feeBalance,
chain,
Expand Down Expand Up @@ -200,7 +200,7 @@ export async function getFee({
});
}

export async function getRelayerFee({
async function getRelayerFee({
asset,
chain,
destinationAddress,
Expand Down Expand Up @@ -250,14 +250,14 @@ async function getWormholeFee({
return;
}

export interface GetMoonChainFeeBalanceParams {
interface GetMoonChainFeeBalanceParams {
balance: AssetAmount;
feeBalance: AssetAmount;
route: MrlAssetRoute;
sourceAddress: string;
}

export async function getMoonChainFeeBalance({
async function getMoonChainFeeBalance({
balance,
feeBalance,
route,
Expand Down
2 changes: 1 addition & 1 deletion packages/mrl/src/getTransferData/getTransferData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
getMrlMin,
} from './getTransferData.utils';

export interface GetTransferDataParams {
interface GetTransferDataParams {
route: MrlAssetRoute;
sourceAddress: string;
destinationAddress: string;
Expand Down
8 changes: 3 additions & 5 deletions packages/mrl/src/getTransferData/getTransferData.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const MOON_CHAIN_AUTOMATIC_GAS_ESTIMATION = {
[moonbaseAlpha.key]: 1470417n,
};

export interface DataParams {
interface DataParams {
destinationData: DestinationChainTransferData;
moonChainData: MoonChainTransferData;
sourceData: SourceTransferData;
Expand Down Expand Up @@ -168,7 +168,7 @@ export async function getMrlBuilderParams({
};
}

export async function getTransact(params: MrlBuilderParams): Promise<Transact> {
async function getTransact(params: MrlBuilderParams): Promise<Transact> {
const { sourceAddress, source, moonChain } = params;
const polkadot = await PolkadotService.create(moonChain);
const moonGasLimit = await getMoonGasLimit(params);
Expand Down Expand Up @@ -199,9 +199,7 @@ export async function getTransact(params: MrlBuilderParams): Promise<Transact> {
};
}

export async function getMoonGasLimit(
params: MrlBuilderParams,
): Promise<bigint> {
async function getMoonGasLimit(params: MrlBuilderParams): Promise<bigint> {
const { asset, isAutomatic, moonChain, source, sourceAddress } = params;

if (!EvmParachain.isAnyParachain(source)) {
Expand Down
1 change: 1 addition & 0 deletions packages/mrl/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './mrl';
export * from './mrl.interfaces';
2 changes: 1 addition & 1 deletion packages/sdk/src/getTransferData/getTransferData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
validateSovereignAccountBalances,
} from './getTransferData.utils';

export interface GetTransferDataParams {
interface GetTransferDataParams {
route: AssetRoute;
sourceAddress: string;
destinationAddress: string;
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion packages/types/src/chain/Chain.utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Chain, defineChain } from 'viem';
import type { ChainAsset } from '../asset';

export interface GetViemChainParams {
interface GetViemChainParams {
id: number;
name: string;
nativeAsset: ChainAsset;
Expand Down
67 changes: 67 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a8afc03

Please sign in to comment.