Skip to content

Commit

Permalink
feat:SystemToSystem (#215)
Browse files Browse the repository at this point in the history
* add system to system direction

* update isLocalSystemTx

* update createTransferTransaction

* update system to system to check palletInstance only if not relay native in order to allow system chains without assets pallet to create native asset xcm transfers

* remove console logs

* update Native direction to include SystemToSystem

* update system to system general index check
lint

* re-add cypress to lookupAssetId test

* update xcmDirections checks in AssetTransferApi to use enum

* update SystemToSystem integration tests

* lint

* update SystemToSystem fetchAssetType tests

* update AssetTransferApi establishDirection unit test for system to system

* update checkIsValidSystemChainAssetId to accept xcm direction

* add tests for getChainidBySpecName

* lint

* update docs

* removed destAddr AccountId20 for SystemToSytem

* abstract isSystemToSystemReserveTransfer conditional

* add asset hub names to SYSTEM PARACHAIN NAMES

* update createPayload to get address for both local and XCM transactions

* remove unecessary fields from submittable data interface
  • Loading branch information
marshacb authored Jul 7, 2023
1 parent e8f095c commit c46efcf
Show file tree
Hide file tree
Showing 35 changed files with 1,366 additions and 135 deletions.
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/classes/AssetsTransferApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">AssetsTransferApi</span></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/AssetsTransferApi.ts#L59">AssetsTransferApi.ts:59</a></li></ul></aside>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/AssetsTransferApi.ts#L63">AssetsTransferApi.ts:63</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand Down Expand Up @@ -83,7 +83,7 @@ <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/TxResult.html" class="tsd-signature-type tsd-kind-interface">TxResult</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/AssetsTransferApi.ts#L89">AssetsTransferApi.ts:89</a></li></ul></aside></li></ul></section>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/AssetsTransferApi.ts#L93">AssetsTransferApi.ts:93</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member"><a id="decodeExtrinsic" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>decode<wbr/>Extrinsic</span><a href="#decodeExtrinsic" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<ul class="tsd-signatures">
Expand Down Expand Up @@ -112,7 +112,7 @@ <h5><span class="tsd-kind-parameter">format</span>: <span class="tsd-signature-t
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/AssetsTransferApi.ts#L446">AssetsTransferApi.ts:446</a></li></ul></aside></li></ul></section>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/AssetsTransferApi.ts#L503">AssetsTransferApi.ts:503</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member"><a id="fetchFeeInfo" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>fetch<wbr/>Fee<wbr/>Info</span><a href="#fetchFeeInfo" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<ul class="tsd-signatures">
Expand Down Expand Up @@ -141,7 +141,7 @@ <h5><span class="tsd-kind-parameter">format</span>: <span class="tsd-signature-t
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">RuntimeDispatchInfo</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">RuntimeDispatchInfoV1</span><span class="tsd-signature-symbol">&gt;</span></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/AssetsTransferApi.ts#L268">AssetsTransferApi.ts:268</a></li></ul></aside></li></ul></section></section></div>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/AssetsTransferApi.ts#L314">AssetsTransferApi.ts:314</a></li></ul></aside></li></ul></section></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
28 changes: 19 additions & 9 deletions docs/enums/Direction.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1>Enumeration Direction</h1></div>
</div>
<div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/types.ts#L29">types.ts:29</a></li></ul></aside>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L29">types.ts:29</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand All @@ -35,6 +35,7 @@ <h3 class="tsd-index-heading">Enumeration Members</h3>
<a href="Direction.html#RelayToSystem" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>Relay<wbr/>To<wbr/>System</span></a>
<a href="Direction.html#SystemToPara" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>System<wbr/>To<wbr/>Para</span></a>
<a href="Direction.html#SystemToRelay" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>System<wbr/>To<wbr/>Relay</span></a>
<a href="Direction.html#SystemToSystem" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>System<wbr/>To<wbr/>System</span></a>
</div></section></div></details></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Enumeration Members</h2>
Expand All @@ -45,55 +46,63 @@ <h3 class="tsd-anchor-link"><span>Para<wbr/>To<wbr/>Para</span><a href="#ParaToP
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/types.ts#L41">types.ts:41</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L45">types.ts:45</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="ParaToRelay" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>Para<wbr/>To<wbr/>Relay</span><a href="#ParaToRelay" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-enum-member">Para<wbr/>To<wbr/>Relay</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;ParaToRelay&quot;</span></div>
<div class="tsd-comment tsd-typography"><p>Parachain to Relay chain.</p>
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/types.ts#L45">types.ts:45</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L49">types.ts:49</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="ParaToSystem" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>Para<wbr/>To<wbr/>System</span><a href="#ParaToSystem" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-enum-member">Para<wbr/>To<wbr/>System</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;ParaToSystem&quot;</span></div>
<div class="tsd-comment tsd-typography"><p>Parachain to System parachain.</p>
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/types.ts#L49">types.ts:49</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L53">types.ts:53</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="RelayToPara" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>Relay<wbr/>To<wbr/>Para</span><a href="#RelayToPara" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-enum-member">Relay<wbr/>To<wbr/>Para</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;RelayToPara&quot;</span></div>
<div class="tsd-comment tsd-typography"><p>Relay chain to Parachain.</p>
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/types.ts#L57">types.ts:57</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L61">types.ts:61</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="RelayToSystem" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>Relay<wbr/>To<wbr/>System</span><a href="#RelayToSystem" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-enum-member">Relay<wbr/>To<wbr/>System</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;RelayToSystem&quot;</span></div>
<div class="tsd-comment tsd-typography"><p>Relay to System Parachain.</p>
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/types.ts#L53">types.ts:53</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L57">types.ts:57</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="SystemToPara" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>System<wbr/>To<wbr/>Para</span><a href="#SystemToPara" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-enum-member">System<wbr/>To<wbr/>Para</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;SystemToPara&quot;</span></div>
<div class="tsd-comment tsd-typography"><p>System parachain to Parachain.</p>
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/types.ts#L33">types.ts:33</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L33">types.ts:33</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="SystemToRelay" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>System<wbr/>To<wbr/>Relay</span><a href="#SystemToRelay" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-enum-member">System<wbr/>To<wbr/>Relay</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;SystemToRelay&quot;</span></div>
<div class="tsd-comment tsd-typography"><p>System parachain to Relay chain.</p>
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/types.ts#L37">types.ts:37</a></li></ul></aside></section></section></div>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L37">types.ts:37</a></li></ul></aside></section>
<section class="tsd-panel tsd-member"><a id="SystemToSystem" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>System<wbr/>To<wbr/>System</span><a href="#SystemToSystem" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<div class="tsd-signature"><span class="tsd-kind-enum-member">System<wbr/>To<wbr/>System</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;SystemToSystem&quot;</span></div>
<div class="tsd-comment tsd-typography"><p>System parachain to System parachain chain.</p>
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/types.ts#L41">types.ts:41</a></li></ul></aside></section></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand All @@ -117,7 +126,8 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon
<li><a href="#RelayToPara" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>Relay<wbr/>To<wbr/>Para</span></a></li>
<li><a href="#RelayToSystem" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>Relay<wbr/>To<wbr/>System</span></a></li>
<li><a href="#SystemToPara" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>System<wbr/>To<wbr/>Para</span></a></li>
<li><a href="#SystemToRelay" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>System<wbr/>To<wbr/>Relay</span></a></li></ul></div></details></div>
<li><a href="#SystemToRelay" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>System<wbr/>To<wbr/>Relay</span></a></li>
<li><a href="#SystemToSystem" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>System<wbr/>To<wbr/>System</span></a></li></ul></div></details></div>
<div class="site-menu">
<nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@substrate/asset-<wbr/>transfer-<wbr/>api -<wbr/> v0.1.0-<wbr/>beta.1</span></a>
<ul class="tsd-small-nested-navigation">
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/constructApiPromise.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h5><span class="tsd-kind-parameter">opts</span>: <span class="tsd-signature-typ
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/ApiInfo.html" class="tsd-signature-type tsd-kind-interface">ApiInfo</a><span class="tsd-signature-symbol">&gt;</span></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/constructApiPromise.ts#L24">constructApiPromise.ts:24</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/constructApiPromise.ts#L24">constructApiPromise.ts:24</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/interfaces/ApiInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">ApiInfo</span></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/2aa29fc/src/constructApiPromise.ts#L12">constructApiPromise.ts:12</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/paritytech/asset-transfer-api/blob/4c11e79/src/constructApiPromise.ts#L12">constructApiPromise.ts:12</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
Loading

0 comments on commit c46efcf

Please sign in to comment.