@paraspell/pallets 8.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 ParaSpell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ <br /><br />
2
+
3
+ <div align="center">
4
+ <h1 align="center">@paraspell/pallets</h1>
5
+ <h4 align="center"> Pallet queries for Polkadot and Kusama Parachains. </h4>
6
+ <p align="center">
7
+ <a href="https://npmjs.com/package/@paraspell/pallets">
8
+ <img alt="version" src="https://img.shields.io/npm/v/@paraspell/pallets?style=flat-square" />
9
+ </a>
10
+ <a href="https://npmjs.com/package/@paraspell/pallets">
11
+ <img alt="downloads" src="https://img.shields.io/npm/dm/@paraspell/pallets?style=flat-square" />
12
+ </a>
13
+ <a href="https://github.com/paraspell/xcm-sdk/actions">
14
+ <img alt="build" src="https://github.com/paraspell/xcm-sdk/actions/workflows/release.yml/badge.svg" />
15
+ </a>
16
+ <a href="https://snyk.io/test/github/paraspell/sdk">
17
+ <img alt="snyk" src="https://snyk.io/test/github/paraspell/sdk/badge.svg" />
18
+ </a>
19
+ </p>
20
+ </div>
21
+
22
+ <br /><br />
23
+ <br /><br />
24
+
25
+ ## Information
26
+
27
+ This package serves as a `core` component for both `@paraspell/sdk` and `@paraspell/sdk-pjs` and is `automatically` installed as a `dependency`. The package on its own offers functionality that can be imported separately and be used in front-end applications. It allows developers to query the `XCM pallets` that Parachains currently support.
28
+
29
+ ## Implementation
30
+
31
+ ### Install package
32
+
33
+ ```bash
34
+ pnpm | npm install || yarn add @paraspell/pallets
35
+ ```
36
+
37
+ ### Import functionality
38
+
39
+ To use this functionality you first have to import it in the following way.
40
+ ```ts
41
+ import { getDefaultPallet, getSupportedPallets, getPalletIndex, SUPPORTED_PALLETS } from '@paraspell/pallets'
42
+ ```
43
+
44
+ ### Get default XCM pallet
45
+
46
+ The function returns the default XCM pallet for selected compatible Parachain.
47
+ ```ts
48
+ getDefaultPallet(node: TNode)
49
+ ```
50
+
51
+ ### Get all supported XCM pallets
52
+
53
+ The function returns all supported XCM pallets for selected compatible Parachain.
54
+ ```ts
55
+ getSupportedPallets(node: TNode)
56
+ ```
57
+
58
+ ### Get index of XCM Pallet
59
+
60
+ The function returns all index of XCM Pallet for selected Parachain.
61
+ ```ts
62
+ getPalletIndex(node: TNode)
63
+ ```
64
+
65
+ ### Print all supported XCM pallets
66
+
67
+ This returns all supported XCM pallets supported by compatible Parachains as constant.
68
+ ```ts
69
+ console.log(SUPPORTED_PALLETS)
70
+ ```
71
+
72
+ ## 💻 Tests
73
+
74
+ - Run compilation using `pnpm compile`
75
+
76
+ - Run linter using `pnpm lint`
77
+
78
+ - Run unit tests using `pnpm test`
79
+
80
+ - Update XCM pallets in the map using script - `pnpm updatePallets`
81
+
82
+ Pallet queries can be tested in [Playground](https://github.com/paraspell/xcm-tools/tree/main/apps/playground).
83
+
84
+ ## License
85
+
86
+ Made with 💛 by [ParaSpell✨](https://paraspell.xyz/)
87
+
88
+ Published under [MIT License](https://playground.paraspell.xyz/xcm-sdk/pallets).
89
+
90
+ ## Support
91
+
92
+ <div align="center">
93
+ <p align="center">
94
+ <img width="200" alt="version" src="https://user-images.githubusercontent.com/55763425/211145923-f7ee2a57-3e63-4b7d-9674-2da9db46b2ee.png" />
95
+ <img width="200" alt="version" src="https://github.com/paraspell/xcm-sdk/assets/55763425/9ed74ebe-9b29-4efd-8e3e-7467ac4caed6" />
96
+ </p>
97
+ </div>