@hardkas/kaspa-rpc 0.8.19-alpha → 0.8.20-alpha

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -15
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -911,21 +911,30 @@ var JsonWrpcKaspaClient = class {
911
911
  else if ("inner" in txObj) txObj = txObj.inner;
912
912
  }
913
913
  const txAny = txObj;
914
- if (txAny && typeof txAny === "object" && txAny.outputs && Array.isArray(txAny.outputs)) {
915
- txAny.outputs.forEach((output) => {
916
- if (typeof output.amount === "string") {
917
- output.amount = Number(output.amount);
918
- }
919
- if (typeof output.value === "string") {
920
- output.value = Number(output.value);
921
- }
922
- });
923
- }
924
- if (txAny && typeof txAny === "object" && txAny.inputs && Array.isArray(txAny.inputs)) {
925
- txAny.inputs.forEach((input) => {
926
- if (typeof input.sequence === "string") input.sequence = Number(input.sequence);
927
- if (typeof input.sigOpCount === "string") input.sigOpCount = Number(input.sigOpCount);
928
- });
914
+ if (txAny && typeof txAny === "object") {
915
+ if (txAny.mass === void 0) txAny.mass = 0;
916
+ if (txAny.outputs && Array.isArray(txAny.outputs)) {
917
+ txAny.outputs.forEach((output) => {
918
+ if (output.amount !== void 0 && output.value === void 0) {
919
+ output.value = output.amount;
920
+ delete output.amount;
921
+ }
922
+ if (typeof output.amount === "string") output.amount = Number(output.amount);
923
+ if (typeof output.value === "string") output.value = Number(output.value);
924
+ if (output.scriptPublicKey && typeof output.scriptPublicKey === "object") {
925
+ if (output.scriptPublicKey.scriptPublicKey !== void 0 && output.scriptPublicKey.script === void 0) {
926
+ output.scriptPublicKey.script = output.scriptPublicKey.scriptPublicKey;
927
+ delete output.scriptPublicKey.scriptPublicKey;
928
+ }
929
+ }
930
+ });
931
+ }
932
+ if (txAny.inputs && Array.isArray(txAny.inputs)) {
933
+ txAny.inputs.forEach((input) => {
934
+ if (typeof input.sequence === "string") input.sequence = Number(input.sequence);
935
+ if (typeof input.sigOpCount === "string") input.sigOpCount = Number(input.sigOpCount);
936
+ });
937
+ }
929
938
  }
930
939
  } catch (e) {
931
940
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardkas/kaspa-rpc",
3
- "version": "0.8.19-alpha",
3
+ "version": "0.8.20-alpha",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "ws": "^8.18.0",
16
- "@hardkas/core": "0.8.19-alpha",
17
- "@hardkas/tx-builder": "0.8.19-alpha"
16
+ "@hardkas/core": "0.8.20-alpha",
17
+ "@hardkas/tx-builder": "0.8.20-alpha"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/ws": "^8.5.13",