@paraspell/sdk 2.0.4 → 2.0.5

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
@@ -5821,24 +5821,62 @@ var index$2 = /*#__PURE__*/Object.freeze({
5821
5821
  sell: sell
5822
5822
  });
5823
5823
 
5824
- //Contains call formatting for opening HRMP channels functionality
5824
+ // Contains call formatting for opening HRMP channels functionality
5825
+ var openChannelInternal = function openChannelInternal(api, origin, destination, maxSize, maxMessageSize) {
5826
+ var _api$tx$module;
5827
+ var serializedApiCallEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
5828
+ var module = 'parasSudoWrapper';
5829
+ var section = 'sudoEstablishHrmpChannel';
5830
+ var parameters = [getParaId(origin), getParaId(destination), maxSize, maxMessageSize];
5831
+ if (serializedApiCallEnabled) {
5832
+ return {
5833
+ module: module,
5834
+ section: section,
5835
+ parameters: parameters
5836
+ };
5837
+ }
5838
+ return api.tx.sudo.sudo((_api$tx$module = api.tx[module])[section].apply(_api$tx$module, parameters));
5839
+ };
5825
5840
  function openChannel(api, origin, destination, maxSize, maxMessageSize) {
5826
- return api.tx.sudo.sudo(api.tx.parasSudoWrapper.sudoEstablishHrmpChannel(getParaId(origin), getParaId(destination), maxSize, maxMessageSize));
5841
+ return openChannelInternal(api, origin, destination, maxSize, maxMessageSize);
5842
+ }
5843
+ function openChannelSerializedApiCall(api, origin, destination, maxSize, maxMessageSize) {
5844
+ return openChannelInternal(api, origin, destination, maxSize, maxMessageSize, true);
5827
5845
  }
5828
5846
 
5829
5847
  var index$1 = /*#__PURE__*/Object.freeze({
5830
5848
  __proto__: null,
5831
- openChannel: openChannel
5849
+ openChannel: openChannel,
5850
+ openChannelSerializedApiCall: openChannelSerializedApiCall
5832
5851
  });
5833
5852
 
5834
- //Contains call formatting for closing HRMP channels functionality
5853
+ // Contains call formatting for closing HRMP channels functionality
5854
+ var closeChannelInternal = function closeChannelInternal(api, origin, inbound, outbound) {
5855
+ var _api$tx$module;
5856
+ var serializedApiCallEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
5857
+ var module = 'hrmp';
5858
+ var section = 'forceCleanHrmp';
5859
+ var parameters = [getParaId(origin), inbound, outbound];
5860
+ if (serializedApiCallEnabled) {
5861
+ return {
5862
+ module: module,
5863
+ section: section,
5864
+ parameters: parameters
5865
+ };
5866
+ }
5867
+ return api.tx.sudo.sudo((_api$tx$module = api.tx[module])[section].apply(_api$tx$module, parameters));
5868
+ };
5835
5869
  function closeChannel(api, origin, inbound, outbound) {
5836
- return api.tx.sudo.sudo(api.tx.hrmp.forceCleanHrmp(getParaId(origin), inbound, outbound));
5870
+ return closeChannelInternal(api, origin, inbound, outbound);
5871
+ }
5872
+ function closeChannelSerializedApiCall(api, origin, inbound, outbound) {
5873
+ return closeChannelInternal(api, origin, inbound, outbound, true);
5837
5874
  }
5838
5875
 
5839
5876
  var index = /*#__PURE__*/Object.freeze({
5840
5877
  __proto__: null,
5841
- closeChannel: closeChannel
5878
+ closeChannel: closeChannel,
5879
+ closeChannelSerializedApiCall: closeChannelSerializedApiCall
5842
5880
  });
5843
5881
 
5844
5882
  var AddLiquidityBuilder = /*#__PURE__*/function () {
@@ -5956,6 +5994,11 @@ var CloseChannelBuilder = /*#__PURE__*/function () {
5956
5994
  value: function build() {
5957
5995
  return closeChannel(this.api, this.from, this._inbound, this._outbound);
5958
5996
  }
5997
+ }, {
5998
+ key: "buildSerializedApiCall",
5999
+ value: function buildSerializedApiCall() {
6000
+ return closeChannelSerializedApiCall(this.api, this.from, this._inbound, this._outbound);
6001
+ }
5959
6002
  }], [{
5960
6003
  key: "create",
5961
6004
  value: function create(api, from) {
@@ -6032,6 +6075,11 @@ var OpenChannelBuilder = /*#__PURE__*/function () {
6032
6075
  value: function build() {
6033
6076
  return openChannel(this.api, this.from, this.to, this._maxSize, this._maxMessageSize);
6034
6077
  }
6078
+ }, {
6079
+ key: "buildSerializedApiCall",
6080
+ value: function buildSerializedApiCall() {
6081
+ return openChannelSerializedApiCall(this.api, this.from, this.to, this._maxSize, this._maxMessageSize);
6082
+ }
6035
6083
  }], [{
6036
6084
  key: "create",
6037
6085
  value: function create(api, from, to) {
package/dist/index.d.ts CHANGED
@@ -111,20 +111,26 @@ declare namespace index$3 {
111
111
  }
112
112
 
113
113
  declare function openChannel(api: ApiPromise, origin: TNode, destination: TNode, maxSize: number, maxMessageSize: number): Extrinsic;
114
+ declare function openChannelSerializedApiCall(api: ApiPromise, origin: TNode, destination: TNode, maxSize: number, maxMessageSize: number): TSerializedApiCall;
114
115
 
115
116
  declare const index$2_openChannel: typeof openChannel;
117
+ declare const index$2_openChannelSerializedApiCall: typeof openChannelSerializedApiCall;
116
118
  declare namespace index$2 {
117
119
  export {
118
120
  index$2_openChannel as openChannel,
121
+ index$2_openChannelSerializedApiCall as openChannelSerializedApiCall,
119
122
  };
120
123
  }
121
124
 
122
125
  declare function closeChannel(api: ApiPromise, origin: TNode, inbound: number, outbound: number): Extrinsic;
126
+ declare function closeChannelSerializedApiCall(api: ApiPromise, origin: TNode, inbound: number, outbound: number): TSerializedApiCall;
123
127
 
124
128
  declare const index$1_closeChannel: typeof closeChannel;
129
+ declare const index$1_closeChannelSerializedApiCall: typeof closeChannelSerializedApiCall;
125
130
  declare namespace index$1 {
126
131
  export {
127
132
  index$1_closeChannel as closeChannel,
133
+ index$1_closeChannelSerializedApiCall as closeChannelSerializedApiCall,
128
134
  };
129
135
  }
130
136
 
@@ -247,21 +253,15 @@ interface AssetAAddLiquidityBuilder {
247
253
  assetA(assetA: number): AssetBAddLiquidityBuilder;
248
254
  }
249
255
 
250
- interface FinalCloseChannelBuilder {
251
- build(): Extrinsic;
252
- }
253
256
  interface OutboundCloseChannelBuilder {
254
- outbound(inbound: number): FinalCloseChannelBuilder;
257
+ outbound(inbound: number): FinalBuilder;
255
258
  }
256
259
  interface InboundCloseChannelBuilder {
257
260
  inbound(inbound: number): OutboundCloseChannelBuilder;
258
261
  }
259
262
 
260
- interface FinalOpenChannelBuilder {
261
- build(): Extrinsic;
262
- }
263
263
  interface MaxMessageSizeOpenChannelBuilder {
264
- maxMessageSize(size: number): FinalOpenChannelBuilder;
264
+ maxMessageSize(size: number): FinalBuilder;
265
265
  }
266
266
  interface MaxSizeOpenChannelBuilder {
267
267
  maxSize(size: number): MaxMessageSizeOpenChannelBuilder;
package/dist/index.mjs CHANGED
@@ -5819,24 +5819,62 @@ var index$2 = /*#__PURE__*/Object.freeze({
5819
5819
  sell: sell
5820
5820
  });
5821
5821
 
5822
- //Contains call formatting for opening HRMP channels functionality
5822
+ // Contains call formatting for opening HRMP channels functionality
5823
+ var openChannelInternal = function openChannelInternal(api, origin, destination, maxSize, maxMessageSize) {
5824
+ var _api$tx$module;
5825
+ var serializedApiCallEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
5826
+ var module = 'parasSudoWrapper';
5827
+ var section = 'sudoEstablishHrmpChannel';
5828
+ var parameters = [getParaId(origin), getParaId(destination), maxSize, maxMessageSize];
5829
+ if (serializedApiCallEnabled) {
5830
+ return {
5831
+ module: module,
5832
+ section: section,
5833
+ parameters: parameters
5834
+ };
5835
+ }
5836
+ return api.tx.sudo.sudo((_api$tx$module = api.tx[module])[section].apply(_api$tx$module, parameters));
5837
+ };
5823
5838
  function openChannel(api, origin, destination, maxSize, maxMessageSize) {
5824
- return api.tx.sudo.sudo(api.tx.parasSudoWrapper.sudoEstablishHrmpChannel(getParaId(origin), getParaId(destination), maxSize, maxMessageSize));
5839
+ return openChannelInternal(api, origin, destination, maxSize, maxMessageSize);
5840
+ }
5841
+ function openChannelSerializedApiCall(api, origin, destination, maxSize, maxMessageSize) {
5842
+ return openChannelInternal(api, origin, destination, maxSize, maxMessageSize, true);
5825
5843
  }
5826
5844
 
5827
5845
  var index$1 = /*#__PURE__*/Object.freeze({
5828
5846
  __proto__: null,
5829
- openChannel: openChannel
5847
+ openChannel: openChannel,
5848
+ openChannelSerializedApiCall: openChannelSerializedApiCall
5830
5849
  });
5831
5850
 
5832
- //Contains call formatting for closing HRMP channels functionality
5851
+ // Contains call formatting for closing HRMP channels functionality
5852
+ var closeChannelInternal = function closeChannelInternal(api, origin, inbound, outbound) {
5853
+ var _api$tx$module;
5854
+ var serializedApiCallEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
5855
+ var module = 'hrmp';
5856
+ var section = 'forceCleanHrmp';
5857
+ var parameters = [getParaId(origin), inbound, outbound];
5858
+ if (serializedApiCallEnabled) {
5859
+ return {
5860
+ module: module,
5861
+ section: section,
5862
+ parameters: parameters
5863
+ };
5864
+ }
5865
+ return api.tx.sudo.sudo((_api$tx$module = api.tx[module])[section].apply(_api$tx$module, parameters));
5866
+ };
5833
5867
  function closeChannel(api, origin, inbound, outbound) {
5834
- return api.tx.sudo.sudo(api.tx.hrmp.forceCleanHrmp(getParaId(origin), inbound, outbound));
5868
+ return closeChannelInternal(api, origin, inbound, outbound);
5869
+ }
5870
+ function closeChannelSerializedApiCall(api, origin, inbound, outbound) {
5871
+ return closeChannelInternal(api, origin, inbound, outbound, true);
5835
5872
  }
5836
5873
 
5837
5874
  var index = /*#__PURE__*/Object.freeze({
5838
5875
  __proto__: null,
5839
- closeChannel: closeChannel
5876
+ closeChannel: closeChannel,
5877
+ closeChannelSerializedApiCall: closeChannelSerializedApiCall
5840
5878
  });
5841
5879
 
5842
5880
  var AddLiquidityBuilder = /*#__PURE__*/function () {
@@ -5954,6 +5992,11 @@ var CloseChannelBuilder = /*#__PURE__*/function () {
5954
5992
  value: function build() {
5955
5993
  return closeChannel(this.api, this.from, this._inbound, this._outbound);
5956
5994
  }
5995
+ }, {
5996
+ key: "buildSerializedApiCall",
5997
+ value: function buildSerializedApiCall() {
5998
+ return closeChannelSerializedApiCall(this.api, this.from, this._inbound, this._outbound);
5999
+ }
5957
6000
  }], [{
5958
6001
  key: "create",
5959
6002
  value: function create(api, from) {
@@ -6030,6 +6073,11 @@ var OpenChannelBuilder = /*#__PURE__*/function () {
6030
6073
  value: function build() {
6031
6074
  return openChannel(this.api, this.from, this.to, this._maxSize, this._maxMessageSize);
6032
6075
  }
6076
+ }, {
6077
+ key: "buildSerializedApiCall",
6078
+ value: function buildSerializedApiCall() {
6079
+ return openChannelSerializedApiCall(this.api, this.from, this.to, this._maxSize, this._maxMessageSize);
6080
+ }
6033
6081
  }], [{
6034
6082
  key: "create",
6035
6083
  value: function create(api, from, to) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": "@paraspell/sdk",
6
6
  "license": "MIT",