diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f246b96..b5d09fbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.1](https://github.com/paritytech/asset-transfer-api/compare/v0.2.0..v0.2.1) + +### Fix + +- fix: explicitly use passed in dest locations for bridgeTransfers ([#406](https://github.com/paritytech/asset-transfer-api/pull/406))([b3a199a](https://github.com/paritytech/asset-transfer-api/commit/b3a199ace74bc951abe9045d70110c1b9eac8089)) + + ## [0.2.0](https://github.com/paritytech/asset-transfer-api/compare/v0.2.0-beta.2..v0.2.0) ### Chore diff --git a/docs/classes/AssetTransferApi.AssetTransferApi.html b/docs/classes/AssetTransferApi.AssetTransferApi.html index 421c7747..4bfea116 100644 --- a/docs/classes/AssetTransferApi.AssetTransferApi.html +++ b/docs/classes/AssetTransferApi.AssetTransferApi.html @@ -1,8 +1,8 @@ -
Fetch estimated fee information for an extrinsic
const feeInfo = assetApi.fetchFeeInfo(tx, 'call');
console.log(feeInfo.toJSON());
a payload, call or submittable
The format the tx is in
-Errors that may be returned by the API.
-Errors that may be returned by the API.
+Not able to find the asset.
-The following option is disabled given the inputs.
-An issue has happened internally.
-The inputted address is invalid.
-The inputted asset is incorrect or invalid, and does not exist given the surrounding specs. +
The following option is disabled given the inputs.
+An issue has happened internally.
+The inputted address is invalid.
+The inputted asset is incorrect or invalid, and does not exist given the surrounding specs.
This exlcudes MultiLocation assets which are handled using InvalidMultiLocationAsset
.
The direction in which these assets are going to be sent is incorrect.
-An input or lack of input to any public facing function by the user is incorrect, and or invalid. +
The direction in which these assets are going to be sent is incorrect.
+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.
-The inputted multilocation is incorrect.
-The following pallet does not support the method to be used.
-The xcm version is invalid.
-Multiple assets have been found for a single token symbol.
-The provided paysWithFeeOrigin asset has no liquidity pool.
-Not Implemented yet.
-The following pallet is not found.
-Not able to find the pertinent registry to gather certain information. This can refer to xcAssets.
-Did not find the correct call in the current runtime.
-The specName was not provided when injecting a new chain in the registry.
-The tokens were not provided when injecting a new chain in the registry.
-Did not find a known consensus system for bridge transaction.
-The provided JS environment is not supported, and the api will not run.
-The inputted multilocation is incorrect.
+The following pallet does not support the method to be used.
+The xcm version is invalid.
+Multiple assets have been found for a single token symbol.
+The provided paysWithFeeOrigin asset has no liquidity pool.
+Not Implemented yet.
+The following pallet is not found.
+Not able to find the pertinent registry to gather certain information. This can refer to xcAssets.
+Did not find the correct call in the current runtime.
+The specName was not provided when injecting a new chain in the registry.
+The tokens were not provided when injecting a new chain in the registry.
+Did not find a known consensus system for bridge transaction.
+The provided JS environment is not supported, and the api will not run.
+Represents all possible tx directions
-Represents all possible tx directions
+Local tx
-Parachain to Parachain.
-Parachain to Relay chain.
-Parachain to System parachain.
-Relay chain to Parachain.
-Relay to System Parachain.
-System parachain to an external GlobalConsensus
chain.
System parachain to Parachain.
-System parachain to Relay chain.
-System parachain to System parachain chain.
-Parachain to Parachain.
+Parachain to Relay chain.
+Parachain to System parachain.
+Relay chain to Parachain.
+Relay to System Parachain.
+System parachain to an external GlobalConsensus
chain.
System parachain to Parachain.
+System parachain to Relay chain.
+System parachain to System parachain chain.
+Construct a Polkadot-js ApiPromise, and retrieve the specName of the chain.
+Construct a Polkadot-js ApiPromise, and retrieve the specName of the chain.
import { constructApiPromise } from '@substrate/asset-transfer-api';
const { api, specName, safeXcmVersion } = constructApiPromise('wss://some_ws_url');
WebSocket Url to connect to.
ApiOptions
-From the root directory run ./<zombienet_binary_name> -p native spawn ./zombienet/<network_file>.toml | tee zombienet.log
From the root directory run yarn start:zombienet-post-script
. You can run this right after running your zombienet network.
You can access the E2E tests and its documentation here.
-Return value for constructApiPromise
Return value for constructApiPromise
Polkadot-js ApiPromise
-Chain name of the chain which the api is connected to.
-SafeXcmVersion for the chain which the api is connected too.
-SpecName of the chain which the api is connected to.
-Chain name of the chain which the api is connected to.
+SafeXcmVersion for the chain which the api is connected too.
+SpecName of the chain which the api is connected to.
+The TransferArgsOpts are the options passed into createTransferTransaction.
-The TransferArgsOpts are the options passed into createTransferTransaction.
+Optional
assetThe XCM TransferType
used to transfer assets.
Provided to construct transferAssetsUsingTypeAndThen
transactions.
Optional
customOptional custom XCM message to be executed on destination chain. +
Optional
customOptional 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 }])
Optional
feesThe XCM TransferType
used to pay fees for an XCM transfer.
+
Optional
feesThe XCM TransferType
used to pay fees for an XCM transfer.
Provided to construct transferAssetsUsingTypeAndThen
transactions.
Optional
formatOption that specifies the format in which to return a transaction. +
Optional
formatOption 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.
Optional
keepFor creating local asset transfers, this will allow for a transferKeepAlive
as oppose
+
Optional
keepFor creating local asset transfers, this will allow for a transferKeepAlive
as oppose
to a transfer
.
Optional
paysAssetId to pay fee's on the destination parachain.
-Optional
paysAssetId to pay fee's on the current common good parachain. +
Optional
paysAssetId to pay fee's on the destination parachain.
+Optional
paysAssetId to pay fee's on the current common good parachain. Polkadot AssetHub: default DOT Kusama AssetHub: default KSM
-Optional
remoteThe RemoteReserve location for an XCM transfer. +
Optional
remoteThe RemoteReserve location for an XCM transfer.
Should be provided when specifying an assetTransferType
of RemoteReserve
.
Optional
remoteThe RemoteReserve location for an XCM transfers' fees. +
Optional
remoteThe RemoteReserve location for an XCM transfers' fees.
Should be provided when specfying a feesTransferType
of RemoteReserve.
Optional
sendersThe SS58 Address the tx will be sent from. This is specifically used for the format payload
.
+
Optional
sendersThe 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
.
Optional
transferBoolean to declare if this will transfer liquidity tokens. +
Optional
transferBoolean to declare if this will transfer liquidity tokens. Default is false.
-Optional
weightOption for applying a custom weightLimit
.
+
Optional
weightOption for applying a custom weightLimit
.
If not inputted it will default to Unlimited
.
Optional
proofProvided when creating limited txs, represents the amount of storage in bytes that can be used by the tx
Optional
refProvided when creating limited txs, represents the allowed amount of computation time the tx can use
-Optional
xcmSet the xcmVersion for message construction. If this is not present a supported version +
Optional
xcmSet 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.
-The TxResult is the result of constructing a transaction. +
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.
-The destination specName of the transaction
-The direction of the cross chain transfer.
-The format type the tx is ouputted in.
-The method used in the transaction.
-The origin specName of the transaction
-The constructed transaction.
-The xcm version that was used to construct the tx.
-The direction of the cross chain transfer.
+The format type the tx is ouputted in.
+The method used in the transaction.
+The origin specName of the transaction
+The constructed transaction.
+The xcm version that was used to construct the tx.
+Options that are appplied at initialization of the AssetTransferApi
.
Options that are appplied at initialization of the AssetTransferApi
.
Optional
chainChain name of the chain which the api is connected to.
Optional
injectedOption to inject chain information into the registry.
Optional
overrideOption to override the registry with the supplied chain information.
Optional
registryWhether or not to apply the registry from the npm package asset-transfer-api-registry
,
or the hosted CDN which updates frequently.
The Format types possible for a constructed transaction.
-The Format types possible for a constructed transaction.
+AssetTransferApi supports three formats to be returned:
+AssetTransferApi supports three formats to be returned:
ExtrinsicPayload
as a hex.Call
as a hex.SubmittableExtrinsic
.The types of local transactions the api can construct.
-The types of local transactions the api can construct.
+The Methods are the collections of methods the API will use to construct a transaction.
-The Methods are the collections of methods the API will use to construct a transaction.
+Types that the registry can be initialized as.
+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.
-The direction of the cross chain transfer. This only concerns XCM transactions.
-The direction of the cross chain transfer. This only concerns XCM transactions.
+
Holds open an api connection to a specified chain within the ApiPromise in order to help +
- Preparing search index...
- The search index is not available
@substrate/asset-transfer-api - v0.2.1Class AssetTransferApi
Holds open an api connection to a specified chain within the ApiPromise in order to help construct transactions for assets and estimating fees.
-Index
Methods
Index
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 Transfer Transaction
Create an asset transfer transaction. This can be either locally on a systems parachain or relay chain, +
Returns Promise<TxResult<T>>
create Transfer Transaction
Create an asset transfer transaction. This can be either locally on a systems parachain or relay chain, or between chains using xcm.
@@ -23,17 +23,17 @@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>>
decode Extrinsic
Decodes the hex of an extrinsic into a string readable format.
+Returns Promise<TxResult<T>>
decode Extrinsic
Decodes the hex of an extrinsic into a string readable format.
Type Parameters
T extends Format
Parameters
encodedTransaction: string
the hex of an extrinsic tx
format: T
The format the tx is in
-Returns string
fetch Fee Info
Fetch estimated fee information for an extrinsic
+Returns string