Skip to content

Commit

Permalink
RelayToSystem inline docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Nov 7, 2023
1 parent 133c9d8 commit aa50738
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/createXcmTypes/RelayToPara.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
*/
export const RelayToPara: 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.
Expand Down Expand Up @@ -49,7 +49,7 @@ export const RelayToPara: 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.
Expand Down Expand Up @@ -80,7 +80,7 @@ export const RelayToPara: ICreateXcmType = {
};
},
/**
* Create a VersionedMultiAsset type.
* Create a VersionedMultiAsset structured type.
*
* @param amounts The amount for a relay native asset. The length will always be one.
* @param xcmVersion The accepted xcm version.
Expand Down
30 changes: 11 additions & 19 deletions src/createXcmTypes/RelayToSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import {
*/
export const RelayToSystem: 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) {
Expand Down Expand Up @@ -51,9 +51,8 @@ export const RelayToSystem: ICreateXcmType = {
};
},
/**
* Create a XcmVersionedMultiLocation type for a destination.
* Create a XcmVersionedMultiLocation structured type for a destination.
*
* @param api ApiPromise
* @param destId The parachain Id of the destination
* @param xcmVersion The accepted xcm version
*/
Expand Down Expand Up @@ -83,12 +82,10 @@ export const RelayToSystem: ICreateXcmType = {
};
},
/**
* Create a VersionedMultiAsset type.
* Create a VersionedMultiAsset structured type.
*
* @param api ApiPromise
* @param assets Assets to be sent
* @param amounts
* @param xcmVersion
* @param amounts The amount for a relay native asset. The length will always be one.
* @param xcmVersion The accepted xcm version.
*/
createAssets: async (amounts: string[], xcmVersion: number): Promise<UnionXcmMultiAssets> => {
const multiAssets = [];
Expand Down Expand Up @@ -121,12 +118,9 @@ export const RelayToSystem: 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
Expand All @@ -138,11 +132,9 @@ export const RelayToSystem: ICreateXcmType = {
}
: { Unlimited: null };
},

/**
* return the correct feeAssetItem based on XCM direction.
*
* @param api ApiPromise
* Return the correct feeAssetItem based on XCM direction.
* In this case it will always be zero since there is no `feeAssetItem` for this direction.
*/
createFeeAssetItem: async (_: ApiPromise): Promise<number> => {
return await Promise.resolve(0);
Expand Down

0 comments on commit aa50738

Please sign in to comment.