@moonbeam-network/xcm-sdk 0.0.24 → 0.0.26

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/README.md CHANGED
@@ -1,16 +1,21 @@
1
- # XCM-SDK
1
+ ![Moonbeam](https://docs.moonbeam.network/images/builders/xcm/sdk/xcm-sdk-banner.png)
2
2
 
3
- ## :warning: This package is not production ready and is in heavy development!
3
+ The Moonbeam XCM SDK enables developers to easily deposit and withdraw assets to Moonbeam/Moonriver from the relay chain and other parachains in the Polkadot/Kusama ecosystem. With the SDK, you don't need to worry about determining the multilocation of the origin or destination assets or which extrinsics are used on which networks to send XCM transfers. To deposit or withdraw assets, you simply define the asset and origin chain you want to deposit from or withdraw back to, along with the sending account's signer, and the amount to send.
4
4
 
5
- ## Installation
5
+ # Documentation
6
+
7
+ - [usage](https://docs.moonbeam.network/builders/xcm/xcm-sdk/xcm-sdk/)
8
+ - [references](https://docs.moonbeam.network/builders/xcm/xcm-sdk/reference/)
9
+
10
+ # Installation
6
11
 
7
12
  ```bash
8
13
  npm i @moonbeam-network/xcm-config @moonbeam-network/xcm-sdk
9
14
  ```
10
15
 
11
- ## Usage
16
+ # Usage
12
17
 
13
- ### Init
18
+ ## Init
14
19
 
15
20
  ```typescript
16
21
  import { init } from '@moonbeam-network/xcm-sdk';
@@ -24,14 +29,14 @@ const { moonbeam } = init({
24
29
  });
25
30
  ```
26
31
 
27
- ### Accounts
32
+ ## Accounts
28
33
 
29
34
  ```typescript
30
35
  const moonbeamAddress = '0xeF46c7649270C912704fB09B75097f6E32208b85';
31
36
  const substrateAddress = '5DG5Fn3ww3KPza1RLoap6QJNzQfEvRebxypDGp35YuMX5y2K';
32
37
  ```
33
38
 
34
- ### Deposit
39
+ ## Deposit
35
40
 
36
41
  ```typescript
37
42
  // moonbeam.symbols is a list of asset symbols that you can deposit/withdraw
@@ -48,7 +53,7 @@ const { min, send } = await from(chains[0]).get(
48
53
  await send(min, (event) => console.log(event));
49
54
  ```
50
55
 
51
- ### Withdraw
56
+ ## Withdraw
52
57
 
53
58
  ```typescript
54
59
  const { chains, to } = moonbeam.withdraw(moonbeam.symbols[0]);
@@ -62,7 +67,7 @@ const { min, send } = await to(chains[0]).get(
62
67
  await send(min, (event) => console.log(event));
63
68
  ```
64
69
 
65
- ### Get balances
70
+ ## Get balances
66
71
 
67
72
  ```typescript
68
73
  const unsubscribe = await moonbeam.subscribeToAssetsBalanceInfo(
@@ -83,7 +88,7 @@ const unsubscribe = await moonbeam.subscribeToAssetsBalanceInfo(
83
88
  unsubscribe();
84
89
  ```
85
90
 
86
- ## Examples
91
+ # Examples
87
92
 
88
93
  - [simple](https://github.com/PureStake/xcm-sdk/blob/main/packages/sdk/examples/simple)
89
94
 
@@ -92,7 +97,24 @@ git clone git@github.com:PureStake/xcm-sdk.git
92
97
  cd packages/sdk/examples/simple/
93
98
  npm i
94
99
 
95
- // edit index.ts by adding your accounts
100
+ # edit index.ts by adding your accounts
96
101
 
97
102
  npm start
98
103
  ```
104
+
105
+ # Tests
106
+
107
+ ## Unit tests
108
+
109
+ ```bash
110
+ npm run test
111
+ ```
112
+
113
+ ## Acceptance tests
114
+
115
+ ```bash
116
+ cp .env.example .env
117
+ # add private key and suri to .env file
118
+
119
+ npm run test:acc
120
+ ```