@paraspell/sdk 0.0.8 → 0.0.10

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/dist/index.cjs CHANGED
@@ -5,6 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  function createAccID(api, account) {
6
6
  return api.createType("AccountId32", account).toHex();
7
7
  }
8
+ function selectLimit(limit, isLimited) {
9
+ if (isLimited) {
10
+ return {
11
+ Limited: limit
12
+ };
13
+ } else {
14
+ return "Unlimited";
15
+ }
16
+ }
8
17
 
9
18
  function transferParaToRelay(api, origin, currency, amount, to) {
10
19
  if (origin == "Karura" || origin == "Bifrost") {
@@ -92,6 +101,50 @@ function transferRelayToPara(api, destination, amount, to) {
92
101
  0
93
102
  );
94
103
  }
104
+ function limitedTransferRelayToPara(api, destination, amount, to, limit, isLimited) {
105
+ return api.tx.xcmPallet.limitedReserveTransferAssets(
106
+ {
107
+ V1: {
108
+ parents: 0,
109
+ interior: {
110
+ X1: {
111
+ Parachain: destination
112
+ }
113
+ }
114
+ }
115
+ },
116
+ {
117
+ V1: {
118
+ parents: 0,
119
+ interior: {
120
+ X1: {
121
+ AccountId32: {
122
+ network: "Any",
123
+ id: createAccID(api, to)
124
+ }
125
+ }
126
+ }
127
+ }
128
+ },
129
+ {
130
+ V1: [
131
+ {
132
+ id: {
133
+ Concrete: {
134
+ parents: 0,
135
+ interior: "Here"
136
+ }
137
+ },
138
+ fun: {
139
+ Fungible: amount
140
+ }
141
+ }
142
+ ]
143
+ },
144
+ 0,
145
+ selectLimit(limit, isLimited)
146
+ );
147
+ }
95
148
  function transferParaToPara(api, origin, destination, currency, amount, to) {
96
149
  if (origin == "Karura" || origin == "Bifrost") {
97
150
  return api.tx.xTokens.transfer(
@@ -150,7 +203,8 @@ const index$2 = {
150
203
  __proto__: null,
151
204
  transferParaToPara: transferParaToPara,
152
205
  transferParaToRelay: transferParaToRelay,
153
- transferRelayToPara: transferRelayToPara
206
+ transferRelayToPara: transferRelayToPara,
207
+ limitedTransferRelayToPara: limitedTransferRelayToPara
154
208
  };
155
209
 
156
210
  function openChannel(api, origin, destination, maxSize, maxMessageSize) {
package/dist/index.d.ts CHANGED
@@ -5,16 +5,19 @@ declare type Extrinsic = SubmittableExtrinsic<'promise'>;
5
5
 
6
6
  declare function transferParaToRelay(api: ApiPromise, origin: string, currency: string, amount: any, to: string): Extrinsic;
7
7
  declare function transferRelayToPara(api: ApiPromise, destination: number, amount: any, to: string): Extrinsic;
8
+ declare function limitedTransferRelayToPara(api: ApiPromise, destination: number, amount: any, to: string, limit: number, isLimited: boolean): Extrinsic;
8
9
  declare function transferParaToPara(api: ApiPromise, origin: string, destination: number, currency: string, amount: any, to: string): Extrinsic;
9
10
 
10
11
  declare const index$2_transferParaToPara: typeof transferParaToPara;
11
12
  declare const index$2_transferParaToRelay: typeof transferParaToRelay;
12
13
  declare const index$2_transferRelayToPara: typeof transferRelayToPara;
14
+ declare const index$2_limitedTransferRelayToPara: typeof limitedTransferRelayToPara;
13
15
  declare namespace index$2 {
14
16
  export {
15
17
  index$2_transferParaToPara as transferParaToPara,
16
18
  index$2_transferParaToRelay as transferParaToRelay,
17
19
  index$2_transferRelayToPara as transferRelayToPara,
20
+ index$2_limitedTransferRelayToPara as limitedTransferRelayToPara,
18
21
  };
19
22
  }
20
23
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,15 @@
1
1
  function createAccID(api, account) {
2
2
  return api.createType("AccountId32", account).toHex();
3
3
  }
4
+ function selectLimit(limit, isLimited) {
5
+ if (isLimited) {
6
+ return {
7
+ Limited: limit
8
+ };
9
+ } else {
10
+ return "Unlimited";
11
+ }
12
+ }
4
13
 
5
14
  function transferParaToRelay(api, origin, currency, amount, to) {
6
15
  if (origin == "Karura" || origin == "Bifrost") {
@@ -88,6 +97,50 @@ function transferRelayToPara(api, destination, amount, to) {
88
97
  0
89
98
  );
90
99
  }
100
+ function limitedTransferRelayToPara(api, destination, amount, to, limit, isLimited) {
101
+ return api.tx.xcmPallet.limitedReserveTransferAssets(
102
+ {
103
+ V1: {
104
+ parents: 0,
105
+ interior: {
106
+ X1: {
107
+ Parachain: destination
108
+ }
109
+ }
110
+ }
111
+ },
112
+ {
113
+ V1: {
114
+ parents: 0,
115
+ interior: {
116
+ X1: {
117
+ AccountId32: {
118
+ network: "Any",
119
+ id: createAccID(api, to)
120
+ }
121
+ }
122
+ }
123
+ }
124
+ },
125
+ {
126
+ V1: [
127
+ {
128
+ id: {
129
+ Concrete: {
130
+ parents: 0,
131
+ interior: "Here"
132
+ }
133
+ },
134
+ fun: {
135
+ Fungible: amount
136
+ }
137
+ }
138
+ ]
139
+ },
140
+ 0,
141
+ selectLimit(limit, isLimited)
142
+ );
143
+ }
91
144
  function transferParaToPara(api, origin, destination, currency, amount, to) {
92
145
  if (origin == "Karura" || origin == "Bifrost") {
93
146
  return api.tx.xTokens.transfer(
@@ -146,7 +199,8 @@ const index$2 = {
146
199
  __proto__: null,
147
200
  transferParaToPara: transferParaToPara,
148
201
  transferParaToRelay: transferParaToRelay,
149
- transferRelayToPara: transferRelayToPara
202
+ transferRelayToPara: transferRelayToPara,
203
+ limitedTransferRelayToPara: limitedTransferRelayToPara
150
204
  };
151
205
 
152
206
  function openChannel(api, origin, destination, maxSize, maxMessageSize) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": "@paraspell/sdk",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "build": "unbuild",
37
37
  "dev": "vitest dev",
38
38
  "lint": "eslint --ext .ts,.js,.mjs,.cjs .",
39
- "release": "pnpm test && standard-version && git push --follow-tags && pnpm publish --access=public",
39
+ "release": "pnpm test && standard-version && git push --follow-tags && pnpm publish --no-git-checks --access=public",
40
40
  "test": "pnpm lint && vitest run --coverage"
41
41
  }
42
42
  }