diff --git a/CHANGELOG.md b/CHANGELOG.md index 39720b0e..57a8ff3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [0.4.1](https://github.com/paritytech/asset-transfer-api/compare/v0.4.0..v0.4.1) + +### Chore + +- chore(deps): update pjs ([#440](https://github.com/paritytech/asset-transfer-api/pull/440))([6187377](https://github.com/paritytech/asset-transfer-api/commit/bc7918e761ad370c369a8e4183c3c30536187377)) + +### Fix + +- fix(bug): fix fetchFeeInfo partial fee ([#439](https://github.com/paritytech/asset-transfer-api/pull/439))([d227a14](https://github.com/paritytech/asset-transfer-api/commit/8238bf090413ae8c655f9a466a077bd90d227a14)) + ## [0.4.0](https://github.com/paritytech/asset-transfer-api/compare/v0.3.1..v0.4.0) ### Feat diff --git a/docs/classes/AssetTransferApi.AssetTransferApi.html b/docs/classes/AssetTransferApi.AssetTransferApi.html index 0a55dd6a..412c84f9 100644 --- a/docs/classes/AssetTransferApi.AssetTransferApi.html +++ b/docs/classes/AssetTransferApi.AssetTransferApi.html @@ -1,8 +1,8 @@ -AssetTransferApi | @substrate/asset-transfer-api - v0.4.0

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

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

  • amounts: string[]

    Array of the amounts of each trapped asset to be claimed

  • beneficiary: string

    Address of the account to receive the trapped assets

  • opts: TransferArgsOpts<T>

    Options

    -
  • Returns Promise<TxResult<T>>

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

    Returns Promise<TxResult<T>>

    • 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',
      xcmVersion: 2,
      }
      )
      } catch (e) {
      console.error(e);
      throw Error(e);
      }
      @@ -24,23 +24,23 @@
    • 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>>

    Returns string

    Returns Promise<null | Result<CallDryRunEffects, XcmDryRunApiError>>

    Returns Promise<null | RuntimeDispatchInfo | RuntimeDispatchInfoV1>

    \ 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 360243de..5af7625d 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.4.0

    Errors that may be returned by the API.

    -

    Enumeration Members

    AssetNotFound +BaseErrorsEnum | @substrate/asset-transfer-api - v0.4.1

    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.

    -
    UnknownConsensusSystem: "UnknownConsensusSystem"

    Did not find a known consensus system for bridge transaction.

    -
    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.

    +
    UnknownConsensusSystem: "UnknownConsensusSystem"

    Did not find a known consensus system for bridge transaction.

    +
    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 b3ad79fa..a6b771dd 100644 --- a/docs/enums/types.Direction.html +++ b/docs/enums/types.Direction.html @@ -1,5 +1,5 @@ -Direction | @substrate/asset-transfer-api - v0.4.0

    Represents all possible tx directions

    -

    Enumeration Members

    Local +Direction | @substrate/asset-transfer-api - v0.4.1

    Represents all possible tx directions

    +

    Enumeration Members

    Enumeration Members

    Local: "Local"

    Local tx

    -
    ParaToPara: "ParaToPara"

    Parachain to Parachain.

    -
    ParaToRelay: "ParaToRelay"

    Parachain to Relay chain.

    -
    ParaToSystem: "ParaToSystem"

    Parachain to System parachain.

    -
    RelayToBridge: "RelayToBridge"

    Relay chain to an external GlobalConsensus chain.

    -
    RelayToPara: "RelayToPara"

    Relay chain to Parachain.

    -
    RelayToSystem: "RelayToSystem"

    Relay to System Parachain.

    -
    SystemToBridge: "SystemToBridge"

    System parachain to an external GlobalConsensus chain.

    -
    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.

    +
    RelayToBridge: "RelayToBridge"

    Relay chain to an external GlobalConsensus chain.

    +
    RelayToPara: "RelayToPara"

    Relay chain to Parachain.

    +
    RelayToSystem: "RelayToSystem"

    Relay to System Parachain.

    +
    SystemToBridge: "SystemToBridge"

    System parachain to an external GlobalConsensus chain.

    +
    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 20640ca1..2e268dfb 100644 --- a/docs/functions/constructApiPromise.constructApiPromise.html +++ b/docs/functions/constructApiPromise.constructApiPromise.html @@ -1,6 +1,6 @@ -constructApiPromise | @substrate/asset-transfer-api - v0.4.0

    Returns Promise<ApiInfo>

    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 0c252808..1ae9749d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -@substrate/asset-transfer-api - v0.4.0

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



    +@substrate/asset-transfer-api - v0.4.1

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



    @substrate/asset-transfer-api

    Asset API used for common good parachains

    @@ -98,7 +98,9 @@

    Asset API used for common good parachains

    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',
    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>
    ) +

    AssetTransferApi & AssetTransferApiOpts & TransferArgsOpts

    // The AssetTransferApi method: `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>
    ) +
    +
    // The AssetTransferApi method: `fetchFeeInfo`

    /**
    * Fetch estimated fee information for an extrinsic
    *
    * @param tx a payload, call or submittable
    * @param format The format the tx is in
    */
    AssetTransferApi.fetchFeeInfo(
    tx: ConstructedFormat<T>,
    format: 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/docs/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;
    };
    @@ -153,4 +155,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 237f515e..f390aac3 100644 --- a/docs/interfaces/constructApiPromise.ApiInfo.html +++ b/docs/interfaces/constructApiPromise.ApiInfo.html @@ -1,10 +1,10 @@ -ApiInfo | @substrate/asset-transfer-api - v0.4.0

    Return value for constructApiPromise

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

    Properties

    api +ApiInfo | @substrate/asset-transfer-api - v0.4.1

    Return value for constructApiPromise

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

    Properties

    api: ApiPromise

    Polkadot-js ApiPromise

    -
    chainName: string

    Chain name of the chain which the api is connected to.

    -
    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 +
    chainName: string

    Chain name of the chain which the api is connected to.

    +
    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 d9583c66..aac089df 100644 --- a/docs/interfaces/types.TransferArgsOpts.html +++ b/docs/interfaces/types.TransferArgsOpts.html @@ -1,5 +1,5 @@ -TransferArgsOpts | @substrate/asset-transfer-api - v0.4.0

    The TransferArgsOpts are the options passed into createTransferTransaction.

    -
    interface TransferArgsOpts {
        assetTransferType?: string;
        customXcmOnDest?: string;
        dryRunCall?: boolean;
        feesTransferType?: string;
        format?: T;
        keepAlive?: boolean;
        paysWithFeeDest?: string;
        paysWithFeeOrigin?: string;
        remoteReserveAssetTransferTypeLocation?: string;
        remoteReserveFeesTransferTypeLocation?: string;
        sendersAddr?: string;
        transferAll?: boolean;
        transferLiquidToken?: boolean;
        weightLimit?: {
            proofSize?: string;
            refTime?: string;
        };
        xcmFeeAsset?: string;
        xcmVersion?: number;
    }

    Type Parameters

    Properties

    assetTransferType? +TransferArgsOpts | @substrate/asset-transfer-api - v0.4.1

    The TransferArgsOpts are the options passed into createTransferTransaction.

    +
    interface TransferArgsOpts {
        assetTransferType?: string;
        customXcmOnDest?: string;
        dryRunCall?: boolean;
        feesTransferType?: string;
        format?: T;
        keepAlive?: boolean;
        paysWithFeeDest?: string;
        paysWithFeeOrigin?: string;
        remoteReserveAssetTransferTypeLocation?: string;
        remoteReserveFeesTransferTypeLocation?: string;
        sendersAddr?: string;
        transferAll?: boolean;
        transferLiquidToken?: boolean;
        weightLimit?: {
            proofSize?: string;
            refTime?: string;
        };
        xcmFeeAsset?: string;
        xcmVersion?: number;
    }

    Type Parameters

    Properties

    assetTransferType?: string

    The XCM TransferType used to transfer assets. Provided to construct transferAssetsUsingTypeAndThen transactions.

    -
    customXcmOnDest?: string

    Optional custom XCM message to be executed on destination chain. +

    customXcmOnDest?: string

    Optional custom XCM message to be executed on destination chain. Should be provided if a custom xcm message is needed after transfering assets. Defaults to Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])

    -
    dryRunCall?: boolean

    Optionally allows for dry running the constructed tx in order get the estimated fees and execution result.

    -
    feesTransferType?: string

    The XCM TransferType used to pay fees for an XCM transfer. +

    dryRunCall?: boolean

    Optionally allows for dry running the constructed tx in order get the estimated fees and execution result.

    +
    feesTransferType?: string

    The XCM TransferType used to pay fees for an XCM transfer. Provided to construct transferAssetsUsingTypeAndThen transactions.

    -
    format?: T

    Option that specifies the format in which to return a transaction. +

    format?: T

    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.

    -
    keepAlive?: boolean

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

    keepAlive?: boolean

    For creating local asset transfers, this will allow for a transferKeepAlive as opposed 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

    -
    remoteReserveAssetTransferTypeLocation?: string

    The RemoteReserve location for an XCM transfer. +

    remoteReserveAssetTransferTypeLocation?: string

    The RemoteReserve location for an XCM transfer. Should be provided when specifying an assetTransferType of RemoteReserve.

    -
    remoteReserveFeesTransferTypeLocation?: string

    The RemoteReserve location for an XCM transfers' fees. +

    remoteReserveFeesTransferTypeLocation?: string

    The RemoteReserve location for an XCM transfers' fees. Should be provided when specfying a feesTransferType of RemoteReserve.

    -
    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.

    -
    transferAll?: boolean

    For creating local asset transfers, this will allow for a transferAll call as opposed +

    transferAll?: boolean

    For creating local asset transfers, this will allow for a transferAll call as opposed to a transfer call.

    -
    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;
    }

    Option for applying a custom weightLimit. +

    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

      -
    xcmFeeAsset?: string

    Optional assetId that will be used to pay for fees. Used with the dryRunCall option to determine fees in the specified asset.

    -
    xcmVersion?: number

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

    xcmFeeAsset?: string

    Optional assetId that will be used to pay for fees. Used with the dryRunCall option to determine fees in the specified asset.

    +
    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 cb1cb350..905ed99f 100644 --- a/docs/interfaces/types.TxResult.html +++ b/docs/interfaces/types.TxResult.html @@ -1,6 +1,6 @@ -TxResult | @substrate/asset-transfer-api - v0.4.0

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

    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";
        forwardedXcmFees?: [VersionedXcm, XcmFee][];
        localXcmFees?: [VersionedXcm, XcmFee];
        method: Methods;
        origin: string;
        tx: ConstructedFormat<T>;
        xcmExecutionResult?: DispatchResultWithPostInfo | XcmDryRunApiError;
        xcmVersion: null | number;
    }

    Type Parameters

    • T

    Properties

    interface TxResult {
        dest: string;
        direction: Direction | "local";
        format: Format | "local";
        forwardedXcmFees?: [VersionedXcm, XcmFee][];
        localXcmFees?: [VersionedXcm, XcmFee];
        method: Methods;
        origin: string;
        tx: ConstructedFormat<T>;
        xcmExecutionResult?: DispatchResultWithPostInfo | XcmDryRunApiError;
        xcmVersion: null | number;
    }

    Type Parameters

    • T

    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.

    -
    forwardedXcmFees?: [VersionedXcm, XcmFee][]

    Description

    List of forwarded xcms and the weights needed to execute them.

    -
    localXcmFees?: [VersionedXcm, XcmFee]

    Description

    Weight needed to execute the local segment of a provided XCM.

    -
    method: Methods

    Description

    The method used in the transaction.

    -
    origin: string

    Description

    The origin specName of the transaction

    -

    Description

    The constructed transaction.

    -
    xcmExecutionResult?: DispatchResultWithPostInfo | XcmDryRunApiError

    Description

    The result of xcm execution.

    -
    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.

    +
    forwardedXcmFees?: [VersionedXcm, XcmFee][]

    Description

    List of forwarded xcms and the weights needed to execute them.

    +
    localXcmFees?: [VersionedXcm, XcmFee]

    Description

    Weight needed to execute the local segment of a provided XCM.

    +
    method: Methods

    Description

    The method used in the transaction.

    +
    origin: string

    Description

    The origin specName of the transaction

    +

    Description

    The constructed transaction.

    +
    xcmExecutionResult?: DispatchResultWithPostInfo | XcmDryRunApiError

    Description

    The result of xcm execution.

    +
    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 26856885..e800431f 100644 --- a/docs/modules/AssetTransferApi.html +++ b/docs/modules/AssetTransferApi.html @@ -1,2 +1,2 @@ -AssetTransferApi | @substrate/asset-transfer-api - v0.4.0
    \ No newline at end of file +AssetTransferApi | @substrate/asset-transfer-api - v0.4.1
    \ No newline at end of file diff --git a/docs/modules/constructApiPromise.html b/docs/modules/constructApiPromise.html index 724edcad..7bd63ab1 100644 --- a/docs/modules/constructApiPromise.html +++ b/docs/modules/constructApiPromise.html @@ -1,3 +1,3 @@ -constructApiPromise | @substrate/asset-transfer-api - v0.4.0

    Index

    Interfaces

    ApiInfo +constructApiPromise | @substrate/asset-transfer-api - v0.4.1
    \ 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 4cb5d18a..3b6d47f9 100644 --- a/docs/modules/errors_BaseError.html +++ b/docs/modules/errors_BaseError.html @@ -1,2 +1,2 @@ -errors/BaseError | @substrate/asset-transfer-api - v0.4.0
    \ No newline at end of file +errors/BaseError | @substrate/asset-transfer-api - v0.4.1
    \ No newline at end of file diff --git a/docs/modules/types.html b/docs/modules/types.html index f1e61031..80f7bb77 100644 --- a/docs/modules/types.html +++ b/docs/modules/types.html @@ -1,4 +1,4 @@ -types | @substrate/asset-transfer-api - v0.4.0

    Index

    Enumerations

    Direction +types | @substrate/asset-transfer-api - v0.4.1
    \ 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 fce33f3e..f6e24c62 100644 --- a/docs/types/types.AssetTransferApiOpts.html +++ b/docs/types/types.AssetTransferApiOpts.html @@ -1,7 +1,7 @@ -AssetTransferApiOpts | @substrate/asset-transfer-api - v0.4.0
    AssetTransferApiOpts<T>: {
        chainName?: string;
        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.4.1
    AssetTransferApiOpts<T>: {
        chainName?: string;
        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 chainName?: string

      Chain name of the chain which the api is connected to.

    • 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 202d6e67..e34a07b1 100644 --- a/docs/types/types.ConstructedFormat.html +++ b/docs/types/types.ConstructedFormat.html @@ -1,2 +1,2 @@ -ConstructedFormat | @substrate/asset-transfer-api - v0.4.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 +ConstructedFormat | @substrate/asset-transfer-api - v0.4.1
    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 f9832f7b..bc0bd2c1 100644 --- a/docs/types/types.Format.html +++ b/docs/types/types.Format.html @@ -1,7 +1,7 @@ -Format | @substrate/asset-transfer-api - v0.4.0
    Format: "payload" | "call" | "submittable"

    AssetTransferApi supports three formats to be returned:

    +Format | @substrate/asset-transfer-api - v0.4.1
    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 2e898b01..46ba5577 100644 --- a/docs/types/types.LocalTransferTypes.html +++ b/docs/types/types.LocalTransferTypes.html @@ -1,2 +1,2 @@ -LocalTransferTypes | @substrate/asset-transfer-api - v0.4.0
    LocalTransferTypes: "assets::transfer" | "assets::transferKeepAlive" | "assets::transferAll" | "foreignAssets::transfer" | "foreignAssets::transferKeepAlive" | "foreignAssets::transferAll" | "balances::transfer" | "balances::transferKeepAlive" | "balances::transferAll" | "poolAssets::transfer" | "poolAssets::transferKeepAlive" | "poolAssets::transferAll" | "tokens::transfer" | "tokens::transferKeepAlive" | "tokens::transferAll"

    The types of local transactions the api can construct.

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

    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 67aa7fef..d4e12911 100644 --- a/docs/types/types.Methods.html +++ b/docs/types/types.Methods.html @@ -1,2 +1,2 @@ -Methods | @substrate/asset-transfer-api - v0.4.0
    Methods: LocalTransferTypes | "transferAssets" | "transferAssetsUsingTypeAndThen" | "limitedReserveTransferAssets" | "limitedTeleportAssets" | "transferMultiasset" | "transferMultiassets" | "transferMultiassetWithFee" | "claimAssets"

    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.4.1
    Methods: LocalTransferTypes | "transferAssets" | "transferAssetsUsingTypeAndThen" | "limitedReserveTransferAssets" | "limitedTeleportAssets" | "transferMultiasset" | "transferMultiassets" | "transferMultiassetWithFee" | "claimAssets"

    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 79d3e621..6ff51599 100644 --- a/docs/types/types.RegistryTypes.html +++ b/docs/types/types.RegistryTypes.html @@ -1,4 +1,4 @@ -RegistryTypes | @substrate/asset-transfer-api - v0.4.0
    RegistryTypes: "CDN" | "NPM"

    Types that the registry can be initialized as.

    +RegistryTypes | @substrate/asset-transfer-api - v0.4.1
    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 4d3cf75a..387b1ca6 100644 --- a/docs/types/types.XcmDirection.html +++ b/docs/types/types.XcmDirection.html @@ -1,2 +1,2 @@ -XcmDirection | @substrate/asset-transfer-api - v0.4.0
    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.4.1
    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 5c8a4e1c..c7d91231 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@substrate/asset-transfer-api", - "version": "0.4.0", + "version": "0.4.1", "description": "", "main": "lib/index.js", "scripts": {