File tree Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 1
- import { forInterParachain } from "src"
2
1
import {
3
2
fetchToPolkadotTransfers ,
4
3
fetchToEthereumTransfers ,
Original file line number Diff line number Diff line change @@ -853,18 +853,35 @@ function createAssetHubTx(
853
853
} ,
854
854
] ,
855
855
}
856
- const destination = { v4 : bridgeLocation ( ethChainId ) }
857
- const beneficiaryLocation = {
858
- v4 : {
859
- parents : 0 ,
860
- interior : { x1 : [ { accountKey20 : { key : beneficiaryAccount } } ] } ,
861
- } ,
856
+ const feeAsset = {
857
+ v4 : assetLocation ,
862
858
}
863
- return parachain . tx . polkadotXcm . transferAssets (
859
+ const destination = { v4 : bridgeLocation ( ethChainId ) }
860
+ let customXcm = parachain . registry . createType ( "XcmVersionedXcm" , {
861
+ v4 : [
862
+ {
863
+ depositAsset : {
864
+ assets : {
865
+ Wild : {
866
+ AllCounted : 1 ,
867
+ } ,
868
+ } ,
869
+ beneficiary : {
870
+ parents : 0 ,
871
+ interior : { x1 : [ { accountKey20 : { key : beneficiaryAccount } } ] } ,
872
+ } ,
873
+ } ,
874
+ } ,
875
+ ] ,
876
+ } )
877
+ let reserveType = asset . location ? "LocalReserve" : "DestinationReserve"
878
+ return parachain . tx . polkadotXcm . transferAssetsUsingTypeAndThen (
864
879
destination ,
865
- beneficiaryLocation ,
866
880
assets ,
867
- 0 ,
881
+ reserveType ,
882
+ feeAsset ,
883
+ reserveType ,
884
+ customXcm ,
868
885
"Unlimited"
869
886
)
870
887
}
You can’t perform that action at this time.
0 commit comments