-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createClient } from "polkadot-api" | ||
import { getSmProvider } from "polkadot-api/sm-provider" | ||
import { smoldot } from "./smoldot" | ||
|
||
export const pasRelayChain = import("polkadot-api/chains/paseo").then( | ||
({ chainSpec }) => smoldot.addChain({ chainSpec }), | ||
) | ||
|
||
export const pasClient = createClient(getSmProvider(pasRelayChain)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { createClient } from "polkadot-api" | ||
import { getSmProvider } from "polkadot-api/sm-provider" | ||
import { smoldot } from "./smoldot" | ||
import { pasRelayChain } from "./pas" | ||
|
||
const smoldotParaChain = Promise.all([ | ||
pasRelayChain, | ||
import("polkadot-api/chains/paseo_asset_hub"), | ||
]).then(([relayChain, { chainSpec }]) => | ||
smoldot.addChain({ chainSpec, potentialRelayChains: [relayChain] }), | ||
) | ||
|
||
export const pasAhClient = createClient(getSmProvider(smoldotParaChain)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { pasAh as descriptors } from "@polkadot-api/descriptors" | ||
import { pasAhClient } from "@/api/clients" | ||
import { AssetInChain } from "../types" | ||
import { fromAssetHubToRelay, watchAccoutFreeBalance } from "../common" | ||
|
||
const api = pasAhClient.getTypedApi(descriptors) | ||
|
||
const chain = "pasAh" | ||
const pas: AssetInChain = { | ||
chain, | ||
symbol: "PAS", | ||
watchFreeBalance: watchAccoutFreeBalance(api), | ||
teleport: { | ||
pas: (...args) => | ||
api.tx.PolkadotXcm.limited_teleport_assets(fromAssetHubToRelay(...args)), | ||
}, | ||
} | ||
|
||
export default [pas] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import relay from "./relay" | ||
import ah from "./ah" | ||
|
||
export default [...relay, ...ah] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { pas as descriptors } from "@polkadot-api/descriptors" | ||
import { pasClient } from "@/api/clients" | ||
import { AssetInChain } from "../types" | ||
import { fromRelayToAssetHub, watchAccoutFreeBalance } from "../common" | ||
|
||
const api = pasClient.getTypedApi(descriptors) | ||
|
||
const pas: AssetInChain = { | ||
chain: "pas", | ||
symbol: "PAS", | ||
watchFreeBalance: watchAccoutFreeBalance(api), | ||
teleport: { | ||
pasAh: (...args) => | ||
api.tx.XcmPallet.limited_teleport_assets(fromRelayToAssetHub(...args)), | ||
}, | ||
} | ||
|
||
export default [pas] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters