Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,031 changes: 1,682 additions & 1,349 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/mesh-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/common",
"version": "1.9.0-beta.102",
"version": "1.9.0-beta.103",
"description": "Contains constants, types and interfaces used across the SDK and different serialization libraries",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions packages/mesh-common/src/interfaces/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface IFetcher {
cursor?: number | string,
): Promise<{ assets: Asset[]; next?: string | number | null }>;
fetchProtocolParameters(epoch: number): Promise<Protocol>;
fetchCostModels(epoch?: number): Promise<number[][]>;
fetchTxInfo(hash: string): Promise<TransactionInfo>;
fetchUTxOs(hash: string, index?: number): Promise<UTxO[]>;
fetchGovernanceProposal(
Expand Down
6 changes: 3 additions & 3 deletions packages/mesh-contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/contract",
"version": "1.9.0-beta.102",
"version": "1.9.0-beta.103",
"description": "List of open-source smart contracts, complete with documentation, live demos, and end-to-end source code. https://meshjs.dev/smart-contracts",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down Expand Up @@ -34,8 +34,8 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/common": "1.9.0-beta.102",
"@meshsdk/core": "1.9.0-beta.102"
"@meshsdk/common": "1.9.0-beta.103",
"@meshsdk/core": "1.9.0-beta.103"
},
"prettier": "@meshsdk/configs/prettier",
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/mesh-core-csl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/core-csl",
"version": "1.9.0-beta.102",
"version": "1.9.0-beta.103",
"description": "Types and utilities functions between Mesh and cardano-serialization-lib",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down Expand Up @@ -38,7 +38,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/common": "1.9.0-beta.102",
"@meshsdk/common": "1.9.0-beta.103",
"@sidan-lab/whisky-js-browser": "^1.0.11",
"@sidan-lab/whisky-js-nodejs": "^1.0.11",
"@types/base32-encoding": "^1.0.2",
Expand Down
7 changes: 3 additions & 4 deletions packages/mesh-core-cst/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/core-cst",
"version": "1.9.0-beta.102",
"version": "1.9.0-beta.103",
"description": "Types and utilities functions between Mesh and cardano-js-sdk",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down Expand Up @@ -44,14 +44,13 @@
"@harmoniclabs/pair": "^1.0.0",
"@harmoniclabs/plutus-data": "1.2.6",
"@harmoniclabs/uplc": "1.4.1",
"@meshsdk/common": "1.9.0-beta.102",
"@meshsdk/common": "1.9.0-beta.103",
"@types/base32-encoding": "^1.0.2",
"base32-encoding": "^1.0.0",
"bech32": "^2.0.0",
"blakejs": "^1.2.1",
"bn.js": "^5.2.0",
"hash.js": "^1.1.7",
"scalus": "^0.17.0"
"hash.js": "^1.1.7"
},
"overrides": {
"@cardano-sdk/crypto": {
Expand Down
40 changes: 28 additions & 12 deletions packages/mesh-core-cst/src/serializer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ import {
} from "../utils";
import { toCardanoCert } from "../utils/certificate";
import { toCardanoMetadataMap } from "../utils/metadata";
import { toCardanoProposalProcedure } from "../utils/proposal";
import { hashScriptData } from "../utils/script-data-hash";
import {
toCardanoGovernanceActionId,
toCardanoVoter,
toCardanoVotingProcedure,
} from "../utils/vote";
import { toCardanoProposalProcedure } from "../utils/proposal";

const VKEY_PUBKEY_SIZE_BYTES = 32;
const VKEY_SIGNATURE_SIZE_BYTES = 64;
Expand Down Expand Up @@ -443,7 +443,6 @@ export class CardanoSDKSerializer implements IMeshTxSerializer {
const serializerCore = new CardanoSDKSerializerCore(
protocolParams ?? this.protocolParams,
);

return serializerCore.coreSerializeTx(txBuilderBody);
};

Expand Down Expand Up @@ -728,7 +727,15 @@ class CardanoSDKSerializerCore {
if (txBuilderBody.fee !== undefined) {
this.txBody.setFee(BigInt(txBuilderBody.fee));
}
this.buildWitnessSet();

const setCostModels = Array.isArray(txBuilderBody.network)
? txBuilderBody.network
: [
DEFAULT_V1_COST_MODEL_LIST,
DEFAULT_V2_COST_MODEL_LIST,
DEFAULT_V3_COST_MODEL_LIST,
];
this.buildWitnessSet(setCostModels);
return new Transaction(
bodyCore,
this.txWitnessSet,
Expand All @@ -738,9 +745,17 @@ class CardanoSDKSerializerCore {

coreSerializeTxWithMockSignatures(txBuilderBody: MeshTxBuilderBody): string {
const bodyCore = this.coreSerializeTxBody(txBuilderBody);
const setCostModels = Array.isArray(txBuilderBody.network)
? txBuilderBody.network
: [
DEFAULT_V1_COST_MODEL_LIST,
DEFAULT_V2_COST_MODEL_LIST,
DEFAULT_V3_COST_MODEL_LIST,
];
const mockWitSet = this.createMockedWitnessSet(
txBuilderBody.expectedNumberKeyWitnesses,
txBuilderBody.expectedByronAddressWitnesses,
setCostModels,
);
return new Transaction(
bodyCore,
Expand Down Expand Up @@ -1449,8 +1464,9 @@ class CardanoSDKSerializerCore {
private createMockedWitnessSet = (
requiredSignaturesCount: number,
requiredByronSignatures: string[],
setCostModels: number[][],
): TransactionWitnessSet => {
this.buildWitnessSet();
this.buildWitnessSet(setCostModels);
const clonedWitnessSet = TransactionWitnessSet.fromCbor(
this.txWitnessSet.toCbor(),
);
Expand All @@ -1470,7 +1486,7 @@ class CardanoSDKSerializerCore {
return clonedWitnessSet;
};

private buildWitnessSet = () => {
private buildWitnessSet = (setCostModels: number[][]) => {
// Add provided scripts to tx witness set
let nativeScripts =
this.txWitnessSet.nativeScripts() ??
Expand Down Expand Up @@ -1529,13 +1545,13 @@ class CardanoSDKSerializerCore {
// After building tx witness set, we must hash it with the cost models
// and put the hash in the tx body
let costModelV1 = Serialization.CostModel.newPlutusV1(
DEFAULT_V1_COST_MODEL_LIST,
setCostModels[0] ?? DEFAULT_V1_COST_MODEL_LIST,
);
let costModelV2 = Serialization.CostModel.newPlutusV2(
DEFAULT_V2_COST_MODEL_LIST,
setCostModels[1] ?? DEFAULT_V2_COST_MODEL_LIST,
);
let costModelV3 = Serialization.CostModel.newPlutusV3(
DEFAULT_V3_COST_MODEL_LIST,
setCostModels[2] ?? DEFAULT_V3_COST_MODEL_LIST,
);
let costModels = new Serialization.Costmdls();

Expand Down Expand Up @@ -1805,8 +1821,8 @@ class CardanoSDKSerializerCore {

private addBasicProposal = (proposal: Proposal) => {
const currentProcedures = this.txBody.proposalProcedures();
const proposalProcedures = currentProcedures
? [...currentProcedures.values()]
const proposalProcedures = currentProcedures
? [...currentProcedures.values()]
: [];

const proposalProcedure = toCardanoProposalProcedure(
Expand All @@ -1819,9 +1835,9 @@ class CardanoSDKSerializerCore {
proposalProcedures.push(proposalProcedure);
this.txBody.setProposalProcedures(
CborSet.fromCore(
proposalProcedures.map(p => p.toCore()),
proposalProcedures.map((p) => p.toCore()),
Serialization.ProposalProcedure.fromCore,
)
),
);
};

Expand Down
12 changes: 6 additions & 6 deletions packages/mesh-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/core",
"version": "1.9.0-beta.102",
"version": "1.9.0-beta.103",
"description": "Mesh SDK Core - https://meshjs.dev/",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down Expand Up @@ -33,11 +33,11 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/common": "1.9.0-beta.102",
"@meshsdk/core-cst": "1.9.0-beta.102",
"@meshsdk/provider": "1.9.0-beta.100",
"@meshsdk/transaction": "1.9.0-beta.102",
"@meshsdk/wallet": "1.9.0-beta.102",
"@meshsdk/common": "1.9.0-beta.103",
"@meshsdk/core-cst": "1.9.0-beta.103",
"@meshsdk/provider": "1.9.0-beta.101",
"@meshsdk/transaction": "1.9.0-beta.103",
"@meshsdk/wallet": "1.9.0-beta.103",
"scalus": "^0.17.0"
},
"prettier": "@meshsdk/configs/prettier",
Expand Down
Loading
Loading