@meshsdk/core-csl 1.6.7 → 1.6.9
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 +20 -7
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +20 -7
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -273,8 +273,8 @@ var deserializeEd25519Signature = (ed25519Signature) => csl.Ed25519Signature.fro
|
|
|
273
273
|
var deserializeNativeScript = (nativeScript) => csl.NativeScript.from_bytes(toBytes(nativeScript));
|
|
274
274
|
var deserializePublicKey = (publicKey) => csl.PublicKey.from_bytes(toBytes(publicKey));
|
|
275
275
|
var deserializePlutusData = (plutusData) => csl.PlutusData.from_bytes(toBytes(plutusData));
|
|
276
|
-
var deserializePlutusScript = (plutusScript, version) => csl.PlutusScript.
|
|
277
|
-
|
|
276
|
+
var deserializePlutusScript = (plutusScript, version) => csl.PlutusScript.from_hex_with_version(
|
|
277
|
+
plutusScript,
|
|
278
278
|
LANGUAGE_VERSIONS[version]
|
|
279
279
|
);
|
|
280
280
|
var deserializeScriptRef = (scriptRef) => csl.ScriptRef.from_bytes(toBytes(scriptRef));
|
|
@@ -496,15 +496,26 @@ var keyHashToRewardAddress = (keyHashHex, network = 1) => {
|
|
|
496
496
|
return rewardAddress;
|
|
497
497
|
};
|
|
498
498
|
|
|
499
|
+
// src/wasm.ts
|
|
500
|
+
var parseWasmResult = (result) => {
|
|
501
|
+
if (result.get_status() !== "success") {
|
|
502
|
+
throw new Error(result.get_data());
|
|
503
|
+
}
|
|
504
|
+
return result.get_data();
|
|
505
|
+
};
|
|
506
|
+
|
|
499
507
|
// src/utils/transaction.ts
|
|
500
|
-
var calculateTxHash = (txHex) =>
|
|
508
|
+
var calculateTxHash = (txHex) => {
|
|
509
|
+
const result = csl.js_calculate_tx_hash(txHex);
|
|
510
|
+
return parseWasmResult(result);
|
|
511
|
+
};
|
|
501
512
|
var signTransaction = (txHex, signingKeys) => {
|
|
502
513
|
const cslSigningKeys = csl.JsVecString.new();
|
|
503
514
|
signingKeys.forEach((key) => {
|
|
504
515
|
cslSigningKeys.add(key);
|
|
505
516
|
});
|
|
506
|
-
const
|
|
507
|
-
return
|
|
517
|
+
const result = csl.js_sign_transaction(txHex, cslSigningKeys);
|
|
518
|
+
return parseWasmResult(result);
|
|
508
519
|
};
|
|
509
520
|
|
|
510
521
|
// src/utils/aiken.ts
|
|
@@ -1007,7 +1018,8 @@ var meshTxBuilderBodyToObj = ({
|
|
|
1007
1018
|
validityRange,
|
|
1008
1019
|
certificates,
|
|
1009
1020
|
signingKey,
|
|
1010
|
-
withdrawals
|
|
1021
|
+
withdrawals,
|
|
1022
|
+
network
|
|
1011
1023
|
}) => {
|
|
1012
1024
|
return {
|
|
1013
1025
|
inputs: inputs.map(txInToObj),
|
|
@@ -1021,7 +1033,8 @@ var meshTxBuilderBodyToObj = ({
|
|
|
1021
1033
|
validityRange: (0, import_common3.validityRangeToObj)(validityRange),
|
|
1022
1034
|
certificates: certificates.map(certificateToObj),
|
|
1023
1035
|
signingKey,
|
|
1024
|
-
withdrawals: withdrawals.map(withdrawalToObj)
|
|
1036
|
+
withdrawals: withdrawals.map(withdrawalToObj),
|
|
1037
|
+
network
|
|
1025
1038
|
};
|
|
1026
1039
|
};
|
|
1027
1040
|
|
package/dist/index.d.cts
CHANGED
|
@@ -94,7 +94,7 @@ declare const utxoToObj: ({ input: { outputIndex, txHash }, output: { address, a
|
|
|
94
94
|
|
|
95
95
|
declare const withdrawalToObj: (withdrawal: Withdrawal) => object;
|
|
96
96
|
|
|
97
|
-
declare const meshTxBuilderBodyToObj: ({ inputs, outputs, collaterals, requiredSignatures, referenceInputs, mints, changeAddress, metadata, validityRange, certificates, signingKey, withdrawals, }: MeshTxBuilderBody) => {
|
|
97
|
+
declare const meshTxBuilderBodyToObj: ({ inputs, outputs, collaterals, requiredSignatures, referenceInputs, mints, changeAddress, metadata, validityRange, certificates, signingKey, withdrawals, network, }: MeshTxBuilderBody) => {
|
|
98
98
|
inputs: object[];
|
|
99
99
|
outputs: object[];
|
|
100
100
|
collaterals: object[];
|
|
@@ -107,6 +107,7 @@ declare const meshTxBuilderBodyToObj: ({ inputs, outputs, collaterals, requiredS
|
|
|
107
107
|
certificates: object[];
|
|
108
108
|
signingKey: string[];
|
|
109
109
|
withdrawals: object[];
|
|
110
|
+
network: string;
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
declare const deserializeAddress: (address: string) => csl.Address;
|
package/dist/index.d.ts
CHANGED
|
@@ -94,7 +94,7 @@ declare const utxoToObj: ({ input: { outputIndex, txHash }, output: { address, a
|
|
|
94
94
|
|
|
95
95
|
declare const withdrawalToObj: (withdrawal: Withdrawal) => object;
|
|
96
96
|
|
|
97
|
-
declare const meshTxBuilderBodyToObj: ({ inputs, outputs, collaterals, requiredSignatures, referenceInputs, mints, changeAddress, metadata, validityRange, certificates, signingKey, withdrawals, }: MeshTxBuilderBody) => {
|
|
97
|
+
declare const meshTxBuilderBodyToObj: ({ inputs, outputs, collaterals, requiredSignatures, referenceInputs, mints, changeAddress, metadata, validityRange, certificates, signingKey, withdrawals, network, }: MeshTxBuilderBody) => {
|
|
98
98
|
inputs: object[];
|
|
99
99
|
outputs: object[];
|
|
100
100
|
collaterals: object[];
|
|
@@ -107,6 +107,7 @@ declare const meshTxBuilderBodyToObj: ({ inputs, outputs, collaterals, requiredS
|
|
|
107
107
|
certificates: object[];
|
|
108
108
|
signingKey: string[];
|
|
109
109
|
withdrawals: object[];
|
|
110
|
+
network: string;
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
declare const deserializeAddress: (address: string) => csl.Address;
|
package/dist/index.js
CHANGED
|
@@ -150,8 +150,8 @@ var deserializeEd25519Signature = (ed25519Signature) => csl.Ed25519Signature.fro
|
|
|
150
150
|
var deserializeNativeScript = (nativeScript) => csl.NativeScript.from_bytes(toBytes(nativeScript));
|
|
151
151
|
var deserializePublicKey = (publicKey) => csl.PublicKey.from_bytes(toBytes(publicKey));
|
|
152
152
|
var deserializePlutusData = (plutusData) => csl.PlutusData.from_bytes(toBytes(plutusData));
|
|
153
|
-
var deserializePlutusScript = (plutusScript, version) => csl.PlutusScript.
|
|
154
|
-
|
|
153
|
+
var deserializePlutusScript = (plutusScript, version) => csl.PlutusScript.from_hex_with_version(
|
|
154
|
+
plutusScript,
|
|
155
155
|
LANGUAGE_VERSIONS[version]
|
|
156
156
|
);
|
|
157
157
|
var deserializeScriptRef = (scriptRef) => csl.ScriptRef.from_bytes(toBytes(scriptRef));
|
|
@@ -375,15 +375,26 @@ var keyHashToRewardAddress = (keyHashHex, network = 1) => {
|
|
|
375
375
|
return rewardAddress;
|
|
376
376
|
};
|
|
377
377
|
|
|
378
|
+
// src/wasm.ts
|
|
379
|
+
var parseWasmResult = (result) => {
|
|
380
|
+
if (result.get_status() !== "success") {
|
|
381
|
+
throw new Error(result.get_data());
|
|
382
|
+
}
|
|
383
|
+
return result.get_data();
|
|
384
|
+
};
|
|
385
|
+
|
|
378
386
|
// src/utils/transaction.ts
|
|
379
|
-
var calculateTxHash = (txHex) =>
|
|
387
|
+
var calculateTxHash = (txHex) => {
|
|
388
|
+
const result = csl.js_calculate_tx_hash(txHex);
|
|
389
|
+
return parseWasmResult(result);
|
|
390
|
+
};
|
|
380
391
|
var signTransaction = (txHex, signingKeys) => {
|
|
381
392
|
const cslSigningKeys = csl.JsVecString.new();
|
|
382
393
|
signingKeys.forEach((key) => {
|
|
383
394
|
cslSigningKeys.add(key);
|
|
384
395
|
});
|
|
385
|
-
const
|
|
386
|
-
return
|
|
396
|
+
const result = csl.js_sign_transaction(txHex, cslSigningKeys);
|
|
397
|
+
return parseWasmResult(result);
|
|
387
398
|
};
|
|
388
399
|
|
|
389
400
|
// src/utils/aiken.ts
|
|
@@ -889,7 +900,8 @@ var meshTxBuilderBodyToObj = ({
|
|
|
889
900
|
validityRange,
|
|
890
901
|
certificates,
|
|
891
902
|
signingKey,
|
|
892
|
-
withdrawals
|
|
903
|
+
withdrawals,
|
|
904
|
+
network
|
|
893
905
|
}) => {
|
|
894
906
|
return {
|
|
895
907
|
inputs: inputs.map(txInToObj),
|
|
@@ -903,7 +915,8 @@ var meshTxBuilderBodyToObj = ({
|
|
|
903
915
|
validityRange: validityRangeToObj(validityRange),
|
|
904
916
|
certificates: certificates.map(certificateToObj),
|
|
905
917
|
signingKey,
|
|
906
|
-
withdrawals: withdrawals.map(withdrawalToObj)
|
|
918
|
+
withdrawals: withdrawals.map(withdrawalToObj),
|
|
919
|
+
network
|
|
907
920
|
};
|
|
908
921
|
};
|
|
909
922
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshsdk/core-csl",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@meshsdk/common": "*",
|
|
42
|
-
"@sidan-lab/sidan-csl-rs-browser": "0.
|
|
43
|
-
"@sidan-lab/sidan-csl-rs-nodejs": "0.
|
|
42
|
+
"@sidan-lab/sidan-csl-rs-browser": "0.7.2",
|
|
43
|
+
"@sidan-lab/sidan-csl-rs-nodejs": "0.7.2",
|
|
44
44
|
"json-bigint": "^1.0.0"
|
|
45
45
|
},
|
|
46
46
|
"prettier": "@meshsdk/configs/prettier",
|