@keldra/sdk 0.1.4 → 0.1.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
@@ -236,9 +236,9 @@ var KeldraClient = class _KeldraClient {
236
236
  }
237
237
  async submit(chain, signedTx) {
238
238
  const rawBytes = parseHex(signedTx);
239
- const padded = padTransaction(rawBytes);
240
239
  let request;
241
240
  if (this.noisePublicKey && this.noiseKid && this.encryptFn) {
241
+ const padded = padTransaction(rawBytes);
242
242
  const encrypted = await this.encryptFn(padded, this.noisePublicKey);
243
243
  const b64 = toBase64(encrypted);
244
244
  request = {
@@ -251,7 +251,8 @@ var KeldraClient = class _KeldraClient {
251
251
  } else {
252
252
  request = {
253
253
  chain,
254
- signed_tx: `0x${toHex(padded)}`,
254
+ // Plain submit must keep the original signed tx bytes.
255
+ signed_tx: signedTx.startsWith("0x") ? signedTx : `0x${toHex(rawBytes)}`,
255
256
  options: { delay_profile: this.defaultDelayProfile }
256
257
  };
257
258
  }
package/dist/index.js CHANGED
@@ -236,9 +236,9 @@ var KeldraClient = class _KeldraClient {
236
236
  }
237
237
  async submit(chain, signedTx) {
238
238
  const rawBytes = parseHex(signedTx);
239
- const padded = padTransaction(rawBytes);
240
239
  let request;
241
240
  if (this.noisePublicKey && this.noiseKid && this.encryptFn) {
241
+ const padded = padTransaction(rawBytes);
242
242
  const encrypted = await this.encryptFn(padded, this.noisePublicKey);
243
243
  const b64 = toBase64(encrypted);
244
244
  request = {
@@ -251,7 +251,8 @@ var KeldraClient = class _KeldraClient {
251
251
  } else {
252
252
  request = {
253
253
  chain,
254
- signed_tx: `0x${toHex(padded)}`,
254
+ // Plain submit must keep the original signed tx bytes.
255
+ signed_tx: signedTx.startsWith("0x") ? signedTx : `0x${toHex(rawBytes)}`,
255
256
  options: { delay_profile: this.defaultDelayProfile }
256
257
  };
257
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keldra/sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "TypeScript SDK for Keldra relay API",
5
5
  "license": "MIT",
6
6
  "author": "Keldra",