From bec5170caf2ed84a12ee5bbda0107a2d2d5421e0 Mon Sep 17 00:00:00 2001 From: Cameron Marshall Date: Tue, 2 Apr 2024 12:53:53 -0400 Subject: [PATCH] chore(release): 0.2.0-beta.0 (#393) --- CHANGELOG.md | 16 +++++++ docs/assets/search.js | 2 +- .../AssetTransferApi.AssetTransferApi.html | 14 +++---- .../errors_BaseError.BaseErrorsEnum.html | 42 +++++++++---------- docs/enums/types.Direction.html | 22 +++++----- ...nstructApiPromise.constructApiPromise.html | 4 +- docs/index.html | 16 +++---- .../constructApiPromise.ApiInfo.html | 10 ++--- docs/interfaces/types.TransferArgsOpts.html | 23 +++++----- docs/interfaces/types.TxResult.html | 18 ++++---- docs/modules/AssetTransferApi.html | 4 +- docs/modules/constructApiPromise.html | 4 +- docs/modules/errors_BaseError.html | 4 +- docs/modules/types.html | 4 +- docs/types/types.AssetTransferApiOpts.html | 4 +- docs/types/types.ConstructedFormat.html | 4 +- docs/types/types.Format.html | 4 +- docs/types/types.LocalTransferTypes.html | 4 +- docs/types/types.Methods.html | 4 +- docs/types/types.RegistryTypes.html | 4 +- docs/types/types.XcmDirection.html | 4 +- package.json | 2 +- 22 files changed, 113 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e2d98f7..eab93527 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [0.2.0-beta.0](https://github.com/paritytech/asset-transfer-api/compare/v0.1.8..v0.2.0-beta.0)(2024-04-02) + +## Breaking Change + +- fix!: always use limited calls ([#392](https://github.com/paritytech/asset-transfer-api/pull/392))([c7ff030](https://github.com/paritytech/asset-transfer-api/commit/c7ff0302dcea92ecb92623832f6460cc56e28491)) +- fix!: change TxResult type ([#391](https://github.com/paritytech/asset-transfer-api/pull/391))([09d1410](https://github.com/paritytech/asset-transfer-api/commit/09d141006f928ecf9b08e2b894ae6dfd4df7d8de)) + +### Fix + +- fix: update lp pool token storage key destructuring ([#390](https://github.com/paritytech/asset-transfer-api/pull/390))([cb7d39f](https://github.com/paritytech/asset-transfer-api/commit/cb7d39fb3ffbaa7f905545268f014c8ba51156ab)) + +### Chore + +- chore(deps): up pjs ([#387](https://github.com/paritytech/asset-transfer-api/pull/387))([f3f2b28](https://github.com/paritytech/asset-transfer-api/commit/f3f2b28bada384be23317cf281bdd74426553461)) +- chore(registry): update registry dep ([#385](https://github.com/paritytech/asset-transfer-api/pull/385))([00064ea](https://github.com/paritytech/asset-transfer-api/commit/00064ea628b0095bcf0227bccb0122ddbd3b4f1d)) + ## [0.1.8](https://github.com/paritytech/asset-transfer-api/compare/v0.1.7..v0.1.8)(2024-03-05) ### Feat diff --git a/docs/assets/search.js b/docs/assets/search.js index e04948c7..ab8838ae 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE7WbbY+bSBKA/4vnq+UM/cbMfMttEilSdjdKZvdOikYRa7cTLhh8gCeTHeW/X3cDpgqqbTDsp4lDvXU91UU3NM+LPPteLO4+PS++xelmcceWizTa6cXd4mVR6PI+j9Jiq/OX+3ixXBzyxFzYZZtDoosXXYHV13KXGKl1Epkrxuhi8XPZ2A3YzXnLtWbf8gBXy8U+ynVaUvbbMNi1aONY5zoqdSPo/kbrMs7SCwO6OmVwWKg9w77Y4zQu4yiJ/9Yf9Je4KPMflwZNWpo52q0u11/faP023WaXxtmxMXOEG73ONvr1U5nHaRGvLw2yb2aGONuCzVLD57AujcD7PNvFhe7NSkLm5MRkUrUTcx8jQnFa6nwbrT1ma/HTk5GKGbSFayaO7iPQCka4vqr0BrtvlH1hFHu9/s3+85JYgPJ8AUVb/Z/17k+dF7A5jQqra2JKcEoMqsjtIXXNjw5vWJ0OLqR2kpQ/9ka3Oy3c/56cCG0veBXnGt8HdHrYNTaOV0+HW4UBiLbT7F22jpIBtq8awRMeW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0q4x3SU2AK0Z+GoF6BPUQNIDX7O5O2GFuxMGfMMtgS/2XG9Kd/UN6MGF0Zewpj5I0CBk5Su0xkB3Ty1AxoSvN6AyanQBWkP4VgRXIv0i48Az93t2ukSlgEFzX3Pk1XMRMzMmVOIUKNXQx9q+nUuvAyAC5uNd31eN3H1VwBzkLfAhs68rOyGgCPrDVyqNmhnx7nClA1QLKFPlS1yVb2JiALXKfP3VKPenBuCaeUddaxPIwTTOfKtK6a6z+MYOTyG+kjuco/JvRfcgJUD+g1MGEnfvsKzuHQL2YHKVvp6xF/GBW1CogY9Z+ZjXr8EARbjZ9VV4r6sZ6EzmG+W+fTyq4eNR0F7w9OwbaHVLNqnuUIMkgcADH2vTluQ+lcOjnc8x3dMCVIhwK99yIcmM3y8X5qCrkzg1wl/uX17+Dwk1Zy+vRQAA"; \ No newline at end of file diff --git a/docs/classes/AssetTransferApi.AssetTransferApi.html b/docs/classes/AssetTransferApi.AssetTransferApi.html index 26263674..be7cdb36 100644 --- a/docs/classes/AssetTransferApi.AssetTransferApi.html +++ b/docs/classes/AssetTransferApi.AssetTransferApi.html @@ -1,31 +1,31 @@ -AssetTransferApi | @substrate/asset-transfer-api - v0.1.8

Holds open an api connection to a specified chain within the ApiPromise in order to help +AssetTransferApi | @substrate/asset-transfer-api - v0.2.0-beta.0

Holds open an api connection to a specified chain within the ApiPromise in order to help construct transactions for assets and estimating fees.

import { AssetTransferApi, constructApiPromise } from '@substrate/asset-transfer-api'

const main = () => {
const { api, specName, safeXcmVersion } = await constructApiPromise('wss://some_ws_url');
const assetsApi = new AssetTransferApi(api, specName, safeXcmVersion);
}
-

Methods

Methods

  • Create an asset transfer transaction. This can be either locally on a systems parachain or relay chain, or between chains using xcm.

    -
    import { TxResult } from '@substrate/asset-transfer-api'

    let callInfo: TxResult<'call'>;
    try {
    callInfo = await assetsApi.createTransferTransaction(
    '1000',
    '5EWNeodpcQ6iYibJ3jmWVe85nsok1EDG8Kk3aFg8ZzpfY1qX',
    ['WND'],
    ['1000000000000'],
    {
    format: 'call',
    isLimited: true,
    xcmVersion: 2,
    }
    )
    } catch (e) {
    console.error(e);
    throw Error(e);
    } +
    import { TxResult } from '@substrate/asset-transfer-api'

    let callInfo: TxResult<'call'>;
    try {
    callInfo = await assetsApi.createTransferTransaction(
    '1000',
    '5EWNeodpcQ6iYibJ3jmWVe85nsok1EDG8Kk3aFg8ZzpfY1qX',
    ['WND'],
    ['1000000000000'],
    {
    format: 'call',
    xcmVersion: 2,
    }
    )
    } catch (e) {
    console.error(e);
    throw Error(e);
    }

    Type Parameters

    Parameters

    • destChainId: string

      ID of the destination (para) chain (‘0’ for Relaychain)

    • destAddr: string

      Address of destination account

    • assetIds: string[]

      Array of assetId's to be transferred

    • amounts: string[]

      Array of the amounts of each token to transfer

    • opts: TransferArgsOpts<T> = {}

      Options

      -

    Returns Promise<TxResult<T>>

  • Decodes the hex of an extrinsic into a string readable format.

    +

Returns Promise<TxResult<T>>

  • Decodes the hex of an extrinsic into a string readable format.

    const decodedExt = assetsApi.decodeExtrinsic(tx, 'call');
    console.log(JSON.parse(decodedExt));

    Type Parameters

    Parameters

    • encodedTransaction: string

      the hex of an extrinsic tx

    • format: T

      The format the tx is in

      -

    Returns string

  • Fetch estimated fee information for an extrinsic

    +

Returns string

  • Fetch estimated fee information for an extrinsic

    const feeInfo = assetApi.fetchFeeInfo(tx, 'call');
    console.log(feeInfo.toJSON());

    Type Parameters

    Parameters

    • tx: ConstructedFormat<T>

      a payload, call or submittable

    • format: T

      The format the tx is in

      -

    Returns Promise<null | RuntimeDispatchInfo | RuntimeDispatchInfoV1>

  • Initialize the registry. This will only activate the registry for the CDN. +

Returns Promise<null | RuntimeDispatchInfo | RuntimeDispatchInfoV1>

  • Initialize the registry. This will only activate the registry for the CDN. If the registryType is NPM the initalization will exit since the AssetTransferApi initializes with the reigstry from the NPM package.

    -

    Returns Promise<void>

\ No newline at end of file +

Returns Promise<void>

\ No newline at end of file diff --git a/docs/enums/errors_BaseError.BaseErrorsEnum.html b/docs/enums/errors_BaseError.BaseErrorsEnum.html index 2ed36c54..f05a9592 100644 --- a/docs/enums/errors_BaseError.BaseErrorsEnum.html +++ b/docs/enums/errors_BaseError.BaseErrorsEnum.html @@ -1,5 +1,5 @@ -BaseErrorsEnum | @substrate/asset-transfer-api - v0.1.8

Errors that may be returned by the API.

-

Enumeration Members

AssetNotFound +BaseErrorsEnum | @substrate/asset-transfer-api - v0.2.0-beta.0

Errors that may be returned by the API.

+

Enumeration Members

AssetNotFound: "AssetNotFound"

Not able to find the asset.

-
DisabledOption: "DisabledOption"

The following option is disabled given the inputs.

-
InternalError: "InternalError"

An issue has happened internally.

-
InvalidAddress: "InvalidAddress"

The inputted address is invalid.

-
InvalidAsset: "InvalidAsset"

The inputted asset is incorrect or invalid, and does not exist given the surrounding specs. +

DisabledOption: "DisabledOption"

The following option is disabled given the inputs.

+
InternalError: "InternalError"

An issue has happened internally.

+
InvalidAddress: "InvalidAddress"

The inputted address is invalid.

+
InvalidAsset: "InvalidAsset"

The inputted asset is incorrect or invalid, and does not exist given the surrounding specs. This exlcudes MultiLocation assets which are handled using InvalidMultiLocationAsset.

-
InvalidDirection: "InvalidDirection"

The direction in which these assets are going to be sent is incorrect.

-
InvalidInput: "InvalidInput"

An input or lack of input to any public facing function by the user is incorrect, and or invalid. +

InvalidDirection: "InvalidDirection"

The direction in which these assets are going to be sent is incorrect.

+
InvalidInput: "InvalidInput"

An input or lack of input to any public facing function by the user is incorrect, and or invalid. This may include using options incorrectly.

-
InvalidMultiLocationAsset: "InvalidMultiLocationAsset"

The inputted multilocation is incorrect.

-
InvalidPallet: "InvalidPallet"

The following pallet does not support the method to be used.

-
InvalidXcmVersion: "InvalidXcmVersion"

The xcm version is invalid.

-
MultipleNonUniqueAssetsFound: "MultipleNonUniqueAssetsFound"

Multiple assets have been found for a single token symbol.

-
NoFeeAssetLpFound: "NoFeeAssetLpFound"

The provided paysWithFeeOrigin asset has no liquidity pool.

-
NotImplemented: "NotImplemented"

Not Implemented yet.

-
PalletNotFound: "PalletNotFound"

The following pallet is not found.

-
RegistryNotFound: "RegistryNotFound"

Not able to find the pertinent registry to gather certain information. This can refer to xcAssets.

-
RuntimeCallNotFound: "RuntimeCallNotFound"

Did not find the correct call in the current runtime.

-
SpecNameNotProvided: "SpecNameNotProvided"

The specName was not provided when injecting a new chain in the registry.

-
TokensNotProvided: "TokensNotProvided"

The tokens were not provided when injecting a new chain in the registry.

-
UnsupportedEnvironment: "UnsupportedEnvironment"

The provided JS environment is not supported, and the api will not run.

-
\ No newline at end of file +
InvalidMultiLocationAsset: "InvalidMultiLocationAsset"

The inputted multilocation is incorrect.

+
InvalidPallet: "InvalidPallet"

The following pallet does not support the method to be used.

+
InvalidXcmVersion: "InvalidXcmVersion"

The xcm version is invalid.

+
MultipleNonUniqueAssetsFound: "MultipleNonUniqueAssetsFound"

Multiple assets have been found for a single token symbol.

+
NoFeeAssetLpFound: "NoFeeAssetLpFound"

The provided paysWithFeeOrigin asset has no liquidity pool.

+
NotImplemented: "NotImplemented"

Not Implemented yet.

+
PalletNotFound: "PalletNotFound"

The following pallet is not found.

+
RegistryNotFound: "RegistryNotFound"

Not able to find the pertinent registry to gather certain information. This can refer to xcAssets.

+
RuntimeCallNotFound: "RuntimeCallNotFound"

Did not find the correct call in the current runtime.

+
SpecNameNotProvided: "SpecNameNotProvided"

The specName was not provided when injecting a new chain in the registry.

+
TokensNotProvided: "TokensNotProvided"

The tokens were not provided when injecting a new chain in the registry.

+
UnsupportedEnvironment: "UnsupportedEnvironment"

The provided JS environment is not supported, and the api will not run.

+
\ No newline at end of file diff --git a/docs/enums/types.Direction.html b/docs/enums/types.Direction.html index 0cfed1af..622886f0 100644 --- a/docs/enums/types.Direction.html +++ b/docs/enums/types.Direction.html @@ -1,5 +1,5 @@ -Direction | @substrate/asset-transfer-api - v0.1.8

Represents all possible tx directions

-

Enumeration Members

Local +Direction | @substrate/asset-transfer-api - v0.2.0-beta.0

Represents all possible tx directions

+

Enumeration Members

Local: "Local"

Local tx

-
ParaToPara: "ParaToPara"

Parachain to Parachain.

-
ParaToRelay: "ParaToRelay"

Parachain to Relay chain.

-
ParaToSystem: "ParaToSystem"

Parachain to System parachain.

-
RelayToPara: "RelayToPara"

Relay chain to Parachain.

-
RelayToSystem: "RelayToSystem"

Relay to System Parachain.

-
SystemToPara: "SystemToPara"

System parachain to Parachain.

-
SystemToRelay: "SystemToRelay"

System parachain to Relay chain.

-
SystemToSystem: "SystemToSystem"

System parachain to System parachain chain.

-
\ No newline at end of file +
ParaToPara: "ParaToPara"

Parachain to Parachain.

+
ParaToRelay: "ParaToRelay"

Parachain to Relay chain.

+
ParaToSystem: "ParaToSystem"

Parachain to System parachain.

+
RelayToPara: "RelayToPara"

Relay chain to Parachain.

+
RelayToSystem: "RelayToSystem"

Relay to System Parachain.

+
SystemToPara: "SystemToPara"

System parachain to Parachain.

+
SystemToRelay: "SystemToRelay"

System parachain to Relay chain.

+
SystemToSystem: "SystemToSystem"

System parachain to System parachain chain.

+
\ No newline at end of file diff --git a/docs/functions/constructApiPromise.constructApiPromise.html b/docs/functions/constructApiPromise.constructApiPromise.html index 649b2c7c..00b917b1 100644 --- a/docs/functions/constructApiPromise.constructApiPromise.html +++ b/docs/functions/constructApiPromise.constructApiPromise.html @@ -1,6 +1,6 @@ -constructApiPromise | @substrate/asset-transfer-api - v0.1.8

Returns Promise<ApiInfo>

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 9cfda345..52032b88 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -@substrate/asset-transfer-api - v0.1.8

@substrate/asset-transfer-api - v0.1.8



+@substrate/asset-transfer-api - v0.2.0-beta.0

@substrate/asset-transfer-api - v0.2.0-beta.0



@substrate/asset-transfer-api

Asset API used for common good parachains

@@ -85,28 +85,28 @@

Asset API used for common good parachains

When the API is initalized using the CDN, node:fetch is being used and is stable in node v21. Therefore it is recommended to use v21 or greater.

Example Usage

NOTE: For more practical usage, and specified examples please look through our ./examples directory to see more use cases. To run these examples: yarn build:examples && node ./examples/build/examples/<file_to_run>.js.

-
import { AssetTransferApi, constructApiPromise } from '@substrate/asset-transfer-api';

// NOTE: This should all be wrapped in an asynchronous layer.

// This constructs a polkadot-js ApiPromise, it is totally viable for one to construct their
// own ApiPromise, and pass it into AssetTransferApi, but keep in mind the `specName`, and `safeXcmVersion` are also necessary.
const { api, specName, safeXcmVersion } = await constructApiPromise('wss://westmint-rpc.polkadot.io');

const assetsApi = new AssetTransferApi(api, specName, safeXcmVersion);

const call = assetsApi.createTransferTransaction(
'2001', // destChainId (If the destination is a relay chain put `0`)
'0x00', // destAddress
['1', '2'], // Array of AssetIds
['1000000000', '2000000000'], // Array of amounts of each token to transfer
{
format: 'call',
isLimited: true,
xcmVersion: 1
} // Options
) +
import { AssetTransferApi, constructApiPromise } from '@substrate/asset-transfer-api';

// NOTE: This should all be wrapped in an asynchronous layer.

// This constructs a polkadot-js ApiPromise, it is totally viable for one to construct their
// own ApiPromise, and pass it into AssetTransferApi, but keep in mind the `specName`, and `safeXcmVersion` are also necessary.
const { api, specName, safeXcmVersion } = await constructApiPromise('wss://westmint-rpc.polkadot.io');

const assetsApi = new AssetTransferApi(api, specName, safeXcmVersion);

const call = assetsApi.createTransferTransaction(
'2001', // destChainId (If the destination is a relay chain put `0`)
'0x00', // destAddress
['1', '2'], // Array of AssetIds
['1000000000', '2000000000'], // Array of amounts of each token to transfer
{
format: 'call',
xcmVersion: 1
} // Options
)

AssetTransferApi & AssetTransferApiOpts & TransferArgsOpts

// The AssetTransferApi exposes one method as of now called: `createTransferTransaction`

/**
* Create an XCM transaction to transfer Assets, or native tokens from one
* chain to another.
*
* @param destChainId ID of the destination (para) chain (‘0’ for Relaychain)
* @param destAddr Address of destination account
* @param assetIds Array of assetId's to be transferred
* @param amounts Array of the amounts of each token to transfer
* @param opts Options
*/
AssetTransferApi.createTransferTransaction(
destChainId: string,
destAddr: string,
assetIds: string[],
amounts: string[],
opts?: TransferArgsOpts<T>
)
// AssetTransferApiOpts are the options for the `AssetTransferApi`

type AssetTransferApiOpts = {
/**
* The injectedRegistry allows you to add custom values to the predefined initialized registry.
* If you would like to see the registry you may visit https://github.com/paritytech/asset-transfer-api-registry/blob/main/registry.json
* When adding a new chain, the `specName` and `tokens` fields are mandatory.
*
* An example input of the registry would be:
* {
* polkadot: {
* '9876': {
* tokens: ['TST'],
* assetsInfo,
* specName: 'testing',
* }
* }
* }
*
* NOTE: It supports adding info for `polkadot`, `kusama`, `westend` and `rococo`.
*/
injectedRegistry?: RequireAtLeastOne<ChainInfoRegistry>;
/**
* The overrideRegistry option allows you to modify chain data already present in the registry,
* either overriding fields' values or adding new information. If the chain of which data is
* being overriden is not present in the registry, it will be treated as if it were
* and injectedRegistry and added following the same logic.
*
* If the chain is present in the registry, it will override only the fields
* present in the passed overrideRegistry, leaving the remaining as is.
*
* An example input for overrideRegistry would be:
* {
* westend: {
* '0': {
* tokens: ['WER'],
* }
* }
* }
*
* This would override the existing native token for the Westend Relay Chain
* to WER instead of WND.
*/
overrideRegistry?: RequireAtLeastOne<ChainInfoRegistry<InjectedChainInfoKeys>>;
/**
* RegistryTypes is a string and can either be 'CDN' or 'NPM'.
*
* CDN - The registry will be initialized with the up to date version given the CDN
* NPM - The registry will be initialized with the NPM version which is updated less frequently.
*/
registryType?: RegistryTypes;
};
-
// The TransferArgsOpts are options that give the possibility of adding certain customization to the transaction.

interface TransferArgsOpts<T extends Format> {
/**
* Option that specifies the format in which to return a transaction.
* It can either be a `payload`, `call`, or `submittable`.
*
* Note: A `submittable` will return a `SubmittableExtrinsic` polkadot-js type, whereas
* a `payload` or `call` will return a hex. By default a `payload` will be returned if nothing is inputted.
*/
format?: T;
/**
* AssetId to pay fees on the current common good parachain.
* Polkadot AssetHub: default DOT
* Kusama AssetHub: default KSM
*/
paysWithFeeOrigin?: string;
/**
* AssetId to pay fees on the destination parachain.
*/
paysWithFeeDest?: string;
/**
* Boolean to declare if this will be with limited XCM transfers.
* Deafult is unlimited.
*/
isLimited?: boolean;
/**
* When isLimited is true, the option for applying a weightLimit is possible.
* If not inputted it will default to `Unlimited`.
*/
weightLimit?: { refTime?: string, proofSize?: string };
/**
* Set the xcmVersion for message construction. If this is not present a supported version
* will be queried, and if there is no supported version a safe version will be queried.
*/
xcmVersion?: number;
/**
* For creating local asset transfers, this will allow for a `transferKeepAlive` as oppose
* to a `transfer`.
*/
keepAlive?: boolean;
/**
* Boolean to declare if this will transfer liquidity tokens.
* Default is false.
*/
transferLiquidToken?: boolean;
} +
// The TransferArgsOpts are options that give the possibility of adding certain customization to the transaction.

interface TransferArgsOpts<T extends Format> {
/**
* Option that specifies the format in which to return a transaction.
* It can either be a `payload`, `call`, or `submittable`.
*
* Note: A `submittable` will return a `SubmittableExtrinsic` polkadot-js type, whereas
* a `payload` will return a `GenericExtrinsicPayload` polkadot-js type and a `call` will return a hex. By default a `payload` will be returned if nothing is inputted.
*/
format?: T;
/**
* AssetId to pay fees on the current common good parachain.
* Polkadot AssetHub: default DOT
* Kusama AssetHub: default KSM
*/
paysWithFeeOrigin?: string;
/**
* AssetId to pay fees on the destination parachain.
*/
paysWithFeeDest?: string;
/**
* Option for applying a custom weightLimit.
* If not inputted it will default to `Unlimited`.
*/
weightLimit?: { refTime?: string, proofSize?: string };
/**
* Set the xcmVersion for message construction. If this is not present a supported version
* will be queried, and if there is no supported version a safe version will be queried.
*/
xcmVersion?: number;
/**
* For creating local asset transfers, this will allow for a `transferKeepAlive` as oppose
* to a `transfer`.
*/
keepAlive?: boolean;
/**
* Boolean to declare if this will transfer liquidity tokens.
* Default is false.
*/
transferLiquidToken?: boolean;
}

Teleport and Reserve Transfer via polkadotXcm pallet

The AssetTransferApi.createTransferTransaction is able to infer what kind of transaction is necessary given the inputs. When sending cross chain transfers, the api does a lot of validation to ensure the inputs are valid, and the assets either exist or don't. This process is done through a registry which is maintained in a separate repo here. If the asset is not in the registry, it will then lookup if that asset exists on-chain and cache it if necessary. On-chain verification is not always possible in respect to the direction the asset is being sent and what the destination chain is since we only maintain one api connection. Therefore, if you would like to inject information into the registry, you can using the injectedRegistry option for the AssetTransferApi.

Transferring assets via xTokens pallet

If the transfer is being sent from a parachain that utilizes the xTokens pallet, the API will detect that and construct the transaction that is necessary. It will construct one of three calls: transferMultiasset, transferMultiassets, or transferMultiassetWithFee. This is only applicable when the intended transfer direction starts from a parachain. The xTokens pallet can be found here.

An example would look like:

-
api.createTransferTransaction(
'1000',
'0xc4db7bcb733e117c0b34ac96354b10d47e84a006b9e7e66a229d174e8ff2a063',
['xcUSDT'],
['1000000'],
{
format: 'call',
isLimited: false,
xcmVersion: 2,
}
); +
api.createTransferTransaction(
'1000',
'0xc4db7bcb733e117c0b34ac96354b10d47e84a006b9e7e66a229d174e8ff2a063',
['xcUSDT'],
['1000000'],
{
format: 'call',
xcmVersion: 2,
}
);

If you would like to run an example to understand the output, run: yarn build:examples && node ./examples/build/examples/paraToSystemTransferMultiAsset.js

-

Foreign Asset Transfers

Sending a foreign asset requires the input assetIds in createTransferTransaction to include the MultiLocation of the asset you would like to send. If a MultiLocation is not passed it will not know if the asset you are sending is a foreign asset. If the MultiLocation passed in has a Parachain id which matches the destChainId input for the transfer, then the output will be a teleport, otherwise it will be a reserve backed transfer.

+

Foreign Asset Transfers

Sending a foreign asset requires the input assetIds in createTransferTransaction to include the MultiLocation of the asset you would like to send. If a MultiLocation is not passed it will not know if the asset you are sending is a foreign asset. If the MultiLocation passed in has a Parachain id which matches the destChainId input for the transfer, then the output will be a limited teleport, otherwise it will be a limited reserve backed transfer.

An example would look like:

-
api.createTransferTransaction(
'2125', // Note: the Parchain ID matches the MultiLocations 'Parachain' ID, making this a teleport of assets
'5EWNeodpcQ6iYibJ3jmWVe85nsok1EDG8Kk3aFg8ZzpfY1qX',
['{"parents":"1","interior":{"X2":[{"Parachain":"2125"},{"GeneralIndex":"0"}]}}'],
['1000000000000'],
{
format: 'call',
isLimited: true,
xcmVersion: 3,
}
) +
api.createTransferTransaction(
'2125', // Note: the Parchain ID matches the MultiLocations 'Parachain' ID, making this a limitedTeleportAssets call
'5EWNeodpcQ6iYibJ3jmWVe85nsok1EDG8Kk3aFg8ZzpfY1qX',
['{"parents":"1","interior":{"X2":[{"Parachain":"2125"},{"GeneralIndex":"0"}]}}'],
['1000000000000'],
{
format: 'call',
xcmVersion: 3,
}
)

If you would like to run an example to understand the output run: yarn build:examples && node ./examples/build/examples/systemToParaTeleportForeignAssets.js

Liquid Pool Asset Transfers

Sending a liquidity token (from the poolAssets pallet) in Asset Hub is as simple as setting the option transferLiquidToken to true. That being said, it does have some nuances. A liquidity token cross-chain transfer must be in the direction of a SystemToPara, and the inputted asset must be a valid integer as a string. The api will error if either of these conditions are not met.

An example would look like:

-
api.createTransferTransaction(
'2023',
'0xF977814e90dA44bFA03b6295A0616a897441aceC',
['0'],
['100000'],
{
format: 'call',
isLimited: true,
xcmVersion: 2,
transferLiquidToken: true,
}
); +
api.createTransferTransaction(
'2023',
'0xF977814e90dA44bFA03b6295A0616a897441aceC',
['0'],
['100000'],
{
format: 'call',
xcmVersion: 2,
transferLiquidToken: true,
}
);

If you would like to run an example to understand the output run: yarn build:examples && node ./examples/build/examples/systemToParaLpToken.js

Local Transactions

Sending an Asset or Native token locally on a System Parachain is easy. In order to create a transaction, ensure the destChainId is the same as the ID of the System Parachain itself. Note, the only System parachains that are supported are Kusama AssetHub, Polkadot AssetHub, Westend AssetHub, Rococo AssetHub (note on how to use it) and as a side effect the only destChainId that is supported is 1000. In addition to that, ensure the length of the assetId's array and amounts array are 1. As sending assets will only accept one asset at a time. Keep in mind transfer, and transferKeepAlive are the only supported calls.

@@ -137,4 +137,4 @@

Asset API used for common good parachains

Running Zombienet

From the root directory run ./<zombienet_binary_name> -p native spawn ./zombienet/<network_file>.toml | tee zombienet.log

Create an asset

From the root directory run yarn start:zombienet-post-script. You can run this right after running your zombienet network.

E2E Testing

You can access the E2E tests and its documentation here.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/interfaces/constructApiPromise.ApiInfo.html b/docs/interfaces/constructApiPromise.ApiInfo.html index 2b3044c6..5f1f8306 100644 --- a/docs/interfaces/constructApiPromise.ApiInfo.html +++ b/docs/interfaces/constructApiPromise.ApiInfo.html @@ -1,8 +1,8 @@ -ApiInfo | @substrate/asset-transfer-api - v0.1.8

Return value for constructApiPromise

-
interface ApiInfo {
    api: ApiPromise;
    safeXcmVersion: number;
    specName: string;
}

Properties

api +ApiInfo | @substrate/asset-transfer-api - v0.2.0-beta.0

Return value for constructApiPromise

+
interface ApiInfo {
    api: ApiPromise;
    safeXcmVersion: number;
    specName: string;
}

Properties

api: ApiPromise

Polkadot-js ApiPromise

-
safeXcmVersion: number

SafeXcmVersion for the chain which the api is connected too.

-
specName: string

SpecName of the chain which the api is connected to.

-
\ No newline at end of file +
safeXcmVersion: number

SafeXcmVersion for the chain which the api is connected too.

+
specName: string

SpecName of the chain which the api is connected to.

+
\ No newline at end of file diff --git a/docs/interfaces/types.TransferArgsOpts.html b/docs/interfaces/types.TransferArgsOpts.html index f0485305..0a3cd91b 100644 --- a/docs/interfaces/types.TransferArgsOpts.html +++ b/docs/interfaces/types.TransferArgsOpts.html @@ -1,6 +1,5 @@ -TransferArgsOpts | @substrate/asset-transfer-api - v0.1.8

The TransferArgsOpts are the options passed into createTransferTransaction.

-
interface TransferArgsOpts {
    format?: T;
    isLimited?: boolean;
    keepAlive?: boolean;
    paysWithFeeDest?: string;
    paysWithFeeOrigin?: string;
    sendersAddr?: string;
    transferLiquidToken?: boolean;
    weightLimit?: {
        proofSize?: string;
        refTime?: string;
    };
    xcmVersion?: number;
}

Type Parameters

Properties

format? -isLimited? +TransferArgsOpts | @substrate/asset-transfer-api - v0.2.0-beta.0

The TransferArgsOpts are the options passed into createTransferTransaction.

+
interface TransferArgsOpts {
    format?: T;
    keepAlive?: boolean;
    paysWithFeeDest?: string;
    paysWithFeeOrigin?: string;
    sendersAddr?: string;
    transferLiquidToken?: boolean;
    weightLimit?: {
        proofSize?: string;
        refTime?: string;
    };
    xcmVersion?: number;
}

Type Parameters

Properties

format? keepAlive? paysWithFeeDest? paysWithFeeOrigin? @@ -12,24 +11,22 @@ It can either be a payload, call, or submittable.

Note: A submittable will return a SubmittableExtrinsic polkadot-js type, whereas a payload or call will return a hex.

-
isLimited?: boolean

Boolean to declare if this will be with limited XCM transfers. -Deafult is unlimited.

-
keepAlive?: boolean

For creating local asset transfers, this will allow for a transferKeepAlive as oppose +

keepAlive?: boolean

For creating local asset transfers, this will allow for a transferKeepAlive as oppose to a transfer.

-
paysWithFeeDest?: string

AssetId to pay fee's on the destination parachain.

-
paysWithFeeOrigin?: string

AssetId to pay fee's on the current common good parachain. +

paysWithFeeDest?: string

AssetId to pay fee's on the destination parachain.

+
paysWithFeeOrigin?: string

AssetId to pay fee's on the current common good parachain. Polkadot AssetHub: default DOT Kusama AssetHub: default KSM

-
sendersAddr?: string

The SS58 Address the tx will be sent from. This is specifically used for the format payload. +

sendersAddr?: string

The SS58 Address the tx will be sent from. This is specifically used for the format payload. It is necessary because the payload will need information such as the nonce.

-
transferLiquidToken?: boolean

Boolean to declare if this will transfer liquidity tokens. +

transferLiquidToken?: boolean

Boolean to declare if this will transfer liquidity tokens. Default is false.

-
weightLimit?: {
    proofSize?: string;
    refTime?: string;
}

When isLimited is true, the option for applying a weightLimit is possible. +

weightLimit?: {
    proofSize?: string;
    refTime?: string;
}

Option for applying a custom weightLimit. If not inputted it will default to Unlimited.

Type declaration

  • Optional proofSize?: string

    Provided when creating limited txs, represents the amount of storage in bytes that can be used by the tx

  • Optional refTime?: string

    Provided when creating limited txs, represents the allowed amount of computation time the tx can use

    -
xcmVersion?: number

Set the xcmVersion for message construction. If this is not present a supported version +

xcmVersion?: number

Set the xcmVersion for message construction. If this is not present a supported version will be queried, and if there is no supported version a safe version will be queried.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/interfaces/types.TxResult.html b/docs/interfaces/types.TxResult.html index 6fba8a54..50d9fc42 100644 --- a/docs/interfaces/types.TxResult.html +++ b/docs/interfaces/types.TxResult.html @@ -1,6 +1,6 @@ -TxResult | @substrate/asset-transfer-api - v0.1.8

The TxResult is the result of constructing a transaction. +TxResult | @substrate/asset-transfer-api - v0.2.0-beta.0

The TxResult is the result of constructing a transaction. T extends Format in the context of the options passed in for the Format the user expects.

-
interface TxResult {
    dest: string;
    direction: Direction | "local";
    format: Format | "local";
    method: Methods;
    origin: string;
    tx: ConstructedFormat<T>;
    xcmVersion: null | number;
}

Type Parameters

  • T

Properties

interface TxResult {
    dest: string;
    direction: Direction | "local";
    format: Format | "local";
    method: Methods;
    origin: string;
    tx: ConstructedFormat<T>;
    xcmVersion: null | number;
}

Type Parameters

  • T

Properties

Properties

dest: string

Description

The destination specName of the transaction

-
direction: Direction | "local"

Description

The direction of the cross chain transfer.

-
format: Format | "local"

Description

The format type the tx is ouputted in.

-
method: Methods

Description

The method used in the transaction.

-
origin: string

Description

The origin specName of the transaction

-

Description

The constructed transaction.

-
xcmVersion: null | number

Description

The xcm version that was used to construct the tx.

-
\ No newline at end of file +
direction: Direction | "local"

Description

The direction of the cross chain transfer.

+
format: Format | "local"

Description

The format type the tx is ouputted in.

+
method: Methods

Description

The method used in the transaction.

+
origin: string

Description

The origin specName of the transaction

+

Description

The constructed transaction.

+
xcmVersion: null | number

Description

The xcm version that was used to construct the tx.

+
\ No newline at end of file diff --git a/docs/modules/AssetTransferApi.html b/docs/modules/AssetTransferApi.html index 59da3ed3..a4c0888a 100644 --- a/docs/modules/AssetTransferApi.html +++ b/docs/modules/AssetTransferApi.html @@ -1,2 +1,2 @@ -AssetTransferApi | @substrate/asset-transfer-api - v0.1.8
\ No newline at end of file +AssetTransferApi | @substrate/asset-transfer-api - v0.2.0-beta.0
\ No newline at end of file diff --git a/docs/modules/constructApiPromise.html b/docs/modules/constructApiPromise.html index 5a762ab6..2c3a90b9 100644 --- a/docs/modules/constructApiPromise.html +++ b/docs/modules/constructApiPromise.html @@ -1,3 +1,3 @@ -constructApiPromise | @substrate/asset-transfer-api - v0.1.8

Index

Interfaces

ApiInfo +constructApiPromise | @substrate/asset-transfer-api - v0.2.0-beta.0
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/modules/errors_BaseError.html b/docs/modules/errors_BaseError.html index 61823d10..88ea1607 100644 --- a/docs/modules/errors_BaseError.html +++ b/docs/modules/errors_BaseError.html @@ -1,2 +1,2 @@ -errors/BaseError | @substrate/asset-transfer-api - v0.1.8
\ No newline at end of file +errors/BaseError | @substrate/asset-transfer-api - v0.2.0-beta.0
\ No newline at end of file diff --git a/docs/modules/types.html b/docs/modules/types.html index 3627ddd1..fae6a7ea 100644 --- a/docs/modules/types.html +++ b/docs/modules/types.html @@ -1,4 +1,4 @@ -types | @substrate/asset-transfer-api - v0.1.8

Index

Enumerations

Direction +types | @substrate/asset-transfer-api - v0.2.0-beta.0
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/types/types.AssetTransferApiOpts.html b/docs/types/types.AssetTransferApiOpts.html index 905763d7..b65b4f10 100644 --- a/docs/types/types.AssetTransferApiOpts.html +++ b/docs/types/types.AssetTransferApiOpts.html @@ -1,6 +1,6 @@ -AssetTransferApiOpts | @substrate/asset-transfer-api - v0.1.8
AssetTransferApiOpts<T>: {
    injectedRegistry?: RequireAtLeastOne<ChainInfoRegistry<T>>;
    overrideRegistry?: RequireAtLeastOne<ChainInfoRegistry<InjectedChainInfoKeys>>;
    registryType?: RegistryTypes;
}

Options that are appplied at initialization of the AssetTransferApi.

+AssetTransferApiOpts | @substrate/asset-transfer-api - v0.2.0-beta.0
AssetTransferApiOpts<T>: {
    injectedRegistry?: RequireAtLeastOne<ChainInfoRegistry<T>>;
    overrideRegistry?: RequireAtLeastOne<ChainInfoRegistry<InjectedChainInfoKeys>>;
    registryType?: RegistryTypes;
}

Options that are appplied at initialization of the AssetTransferApi.

Type Parameters

  • T extends ChainInfoKeys | InjectedChainInfoKeys

Type declaration

  • Optional injectedRegistry?: RequireAtLeastOne<ChainInfoRegistry<T>>

    Option to inject chain information into the registry.

  • Optional overrideRegistry?: RequireAtLeastOne<ChainInfoRegistry<InjectedChainInfoKeys>>

    Option to override the registry with the supplied chain information.

  • Optional registryType?: RegistryTypes

    Whether or not to apply the registry from the npm package asset-transfer-api-registry, or the hosted CDN which updates frequently.

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/types/types.ConstructedFormat.html b/docs/types/types.ConstructedFormat.html index f48718db..20d7519e 100644 --- a/docs/types/types.ConstructedFormat.html +++ b/docs/types/types.ConstructedFormat.html @@ -1,2 +1,2 @@ -ConstructedFormat | @substrate/asset-transfer-api - v0.1.8
ConstructedFormat<T>: T extends "payload"
    ? `0x${string}`
    : T extends "call"
        ? `0x${string}`
        : T extends "submittable"
            ? SubmittableExtrinsic<"promise", ISubmittableResult>
            : never

The Format types possible for a constructed transaction.

-

Type Parameters

  • T

\ No newline at end of file +ConstructedFormat | @substrate/asset-transfer-api - v0.2.0-beta.0
ConstructedFormat<T>: T extends "payload"
    ? GenericExtrinsicPayload
    : T extends "call"
        ? `0x${string}`
        : T extends "submittable"
            ? SubmittableExtrinsic<"promise", ISubmittableResult>
            : never

The Format types possible for a constructed transaction.

+

Type Parameters

  • T

\ No newline at end of file diff --git a/docs/types/types.Format.html b/docs/types/types.Format.html index 2bb4e12d..0e71abd0 100644 --- a/docs/types/types.Format.html +++ b/docs/types/types.Format.html @@ -1,7 +1,7 @@ -Format | @substrate/asset-transfer-api - v0.1.8
Format: "payload" | "call" | "submittable"

AssetTransferApi supports three formats to be returned:

+Format | @substrate/asset-transfer-api - v0.2.0-beta.0
Format: "payload" | "call" | "submittable"

AssetTransferApi supports three formats to be returned:

  • payload: This returns a Polkadot-js ExtrinsicPayload as a hex.
  • call: This returns a Polkadot-js Call as a hex.
  • submittable: This returns a Polkadot-js SubmittableExtrinsic.
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/types/types.LocalTransferTypes.html b/docs/types/types.LocalTransferTypes.html index 8d6c1a84..bcf75cf7 100644 --- a/docs/types/types.LocalTransferTypes.html +++ b/docs/types/types.LocalTransferTypes.html @@ -1,2 +1,2 @@ -LocalTransferTypes | @substrate/asset-transfer-api - v0.1.8
LocalTransferTypes: "assets::transfer" | "assets::transferKeepAlive" | "foreignAssets::transfer" | "foreignAssets::transferKeepAlive" | "balances::transfer" | "balances::transferKeepAlive" | "poolAssets::transfer" | "poolAssets::transferKeepAlive" | "tokens::transfer" | "tokens::transferKeepAlive"

The types of local transactions the api can construct.

-
\ No newline at end of file +LocalTransferTypes | @substrate/asset-transfer-api - v0.2.0-beta.0
LocalTransferTypes: "assets::transfer" | "assets::transferKeepAlive" | "foreignAssets::transfer" | "foreignAssets::transferKeepAlive" | "balances::transfer" | "balances::transferKeepAlive" | "poolAssets::transfer" | "poolAssets::transferKeepAlive" | "tokens::transfer" | "tokens::transferKeepAlive"

The types of local transactions the api can construct.

+
\ No newline at end of file diff --git a/docs/types/types.Methods.html b/docs/types/types.Methods.html index d0389c77..0880e85b 100644 --- a/docs/types/types.Methods.html +++ b/docs/types/types.Methods.html @@ -1,2 +1,2 @@ -Methods | @substrate/asset-transfer-api - v0.1.8
Methods: LocalTransferTypes | "transferAssets" | "reserveTransferAssets" | "limitedReserveTransferAssets" | "teleportAssets" | "limitedTeleportAssets" | "transferMultiasset" | "transferMultiassets" | "transferMultiassetWithFee"

The Methods are the collections of methods the API will use to construct a transaction.

-
\ No newline at end of file +Methods | @substrate/asset-transfer-api - v0.2.0-beta.0
Methods: LocalTransferTypes | "transferAssets" | "limitedReserveTransferAssets" | "limitedTeleportAssets" | "transferMultiasset" | "transferMultiassets" | "transferMultiassetWithFee"

The Methods are the collections of methods the API will use to construct a transaction.

+
\ No newline at end of file diff --git a/docs/types/types.RegistryTypes.html b/docs/types/types.RegistryTypes.html index a2958784..13dcebdf 100644 --- a/docs/types/types.RegistryTypes.html +++ b/docs/types/types.RegistryTypes.html @@ -1,4 +1,4 @@ -RegistryTypes | @substrate/asset-transfer-api - v0.1.8
RegistryTypes: "CDN" | "NPM"

Types that the registry can be initialized as.

+RegistryTypes | @substrate/asset-transfer-api - v0.2.0-beta.0
RegistryTypes: "CDN" | "NPM"

Types that the registry can be initialized as.

CDN - The registry will be initialized with the up to date version given the CDN NPM - The registry will be initialized with the NPM version which is updated less frequently.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/types/types.XcmDirection.html b/docs/types/types.XcmDirection.html index 4ad14530..e617327e 100644 --- a/docs/types/types.XcmDirection.html +++ b/docs/types/types.XcmDirection.html @@ -1,2 +1,2 @@ -XcmDirection | @substrate/asset-transfer-api - v0.1.8
XcmDirection: Exclude<Direction, "Local">

The direction of the cross chain transfer. This only concerns XCM transactions.

-
\ No newline at end of file +XcmDirection | @substrate/asset-transfer-api - v0.2.0-beta.0
XcmDirection: Exclude<Direction, "Local">

The direction of the cross chain transfer. This only concerns XCM transactions.

+
\ No newline at end of file diff --git a/package.json b/package.json index 47b29698..9efb6f81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@substrate/asset-transfer-api", - "version": "0.1.8", + "version": "0.2.0-beta.0", "description": "", "main": "lib/index.js", "scripts": {