From 6e1beb04382f952694120775824c23bdff22cd66 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Tue, 7 Nov 2023 19:01:45 -0500 Subject: [PATCH] SystemToPara inline docs --- src/createXcmTypes/SystemToPara.ts | 53 ++++++++++++++---------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/src/createXcmTypes/SystemToPara.ts b/src/createXcmTypes/SystemToPara.ts index a3f120fa..47b2200a 100644 --- a/src/createXcmTypes/SystemToPara.ts +++ b/src/createXcmTypes/SystemToPara.ts @@ -32,10 +32,10 @@ import { sortMultiAssetsAscending } from './util/sortMultiAssetsAscending'; export const SystemToPara: ICreateXcmType = { /** - * Create a XcmVersionedMultiLocation type for a beneficiary. + * Create a XcmVersionedMultiLocation structured type for a beneficiary. * - * @param accountId The accountId of the beneficiary - * @param xcmVersion The accepted xcm version + * @param accountId The accountId of the beneficiary. + * @param xcmVersion The accepted xcm version. */ createBeneficiary: (accountId: string, xcmVersion?: number): XcmDestBenificiary => { if (xcmVersion == 2) { @@ -65,10 +65,10 @@ export const SystemToPara: ICreateXcmType = { }; }, /** - * Create a XcmVersionedMultiLocation type for a destination. + * Create a XcmVersionedMultiLocation structured type for a destination. * - * @param destId The parachain Id of the destination - * @param xcmVersion The accepted xcm version + * @param destId The parachain Id of the destination. + * @param xcmVersion The accepted xcm version. */ createDest: (destId: string, xcmVersion?: number): XcmDestBenificiary => { if (xcmVersion === 2) { @@ -100,11 +100,13 @@ export const SystemToPara: ICreateXcmType = { }; }, /** - * Create a VersionedMultiAsset type. + * Create a VersionedMultiAsset structured type. * - * @param assets - * @param amounts - * @param xcmVersion + * @param amounts Amount per asset. It will match the `assets` length. + * @param xcmVersion The accepted xcm version. + * @param specName The specname of the chain the api is connected to. + * @param assets The assets to create into xcm `MultiAssets`. + * @param opts Options regarding the registry, and types of asset transfers. */ createAssets: async ( amounts: string[], @@ -136,12 +138,9 @@ export const SystemToPara: ICreateXcmType = { } }, /** - * Create an XcmV3WeightLimit type. + * Create an Xcm WeightLimit structured type. * - * @param api ApiPromise - * @param isLimited Whether the tx is limited - * @param refTime amount of computation time - * @param proofSize amount of storage to be used + * @param opts Options that are used for WeightLimit. */ createWeightLimit: (opts: CreateWeightLimitOpts): XcmWeight => { return opts.isLimited && opts.weightLimit?.refTime && opts.weightLimit?.proofSize @@ -153,17 +152,11 @@ export const SystemToPara: ICreateXcmType = { } : { Unlimited: null }; }, - /** - * returns the correct feeAssetItem based on XCM direction. + * Returns the correct `feeAssetItem` based on XCM direction. * * @param api ApiPromise - * @param paysWithFeeDest string - * @param specName string - * @param assetIds string[] - * @param amounts string[] - * @xcmVersion number - * + * @param opts Options that are used for fee asset construction. */ createFeeAssetItem: async (api: ApiPromise, opts: CreateFeeAssetItemOpts): Promise => { const { @@ -214,12 +207,16 @@ export const SystemToPara: ICreateXcmType = { }; /** - * Creates and returns a MultiAsset array for system parachains based on provided specName, assets and amounts + * Create multiassets for SystemToPara direction. * - * @param api ApiPromise[] - * @param amounts string[] - * @param specName string - * @param assets string[] + * @param api ApiPromise + * @param amounts Amount per asset. It will match the `assets` length. + * @param specName The specname of the chain the api is connected to. + * @param assets The assets to create into xcm `MultiAssets`. + * @param xcmVersion The accepted xcm version. + * @param registry The asset registry used to construct MultiLocations. + * @param isForeignAssetsTransfer Whether this transfer is a foreign assets transfer. + * @param isLiquidTokenTransfer Whether this transfer is a liquid pool assets transfer. */ export const createSystemToParaMultiAssets = async ( api: ApiPromise,