Skip to content

Commit

Permalink
Merge pull request #421 from MeshJS/feature-update/offline-evaluator
Browse files Browse the repository at this point in the history
Feature update/offline evaluator
  • Loading branch information
jinglescode authored Dec 2, 2024
2 parents f0fcef8 + a943dad commit 30910bd
Show file tree
Hide file tree
Showing 20 changed files with 413 additions and 100 deletions.
3 changes: 3 additions & 0 deletions apps/playground/src/pages/apis/txbuilder/basics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import TxbuilderInitializeTxbuilder from "./initialize-txbuilder";
import TxbuilderMultisig from "./multisig";
import TxbuilderMultisigNativeScript from "./multisig-native-script";
import TxbuilderSendValues from "./send-values";
import TxbuilderSetFee from "./set-fee";
import TxbuilderSetNetwork from "./set-network";
import TxbuilderSetRequiredSigners from "./set-required-signers";
import TxbuilderSetTime from "./set-time";
Expand All @@ -30,6 +31,7 @@ const ReactPage: NextPage = () => {
{ label: "Set required signers", to: "requiredSigners" },
{ label: "Set time", to: "setTime" },
{ label: "Set network", to: "setNetwork" },
{ label: "Set fee", to: "setFee" },
];

return (
Expand Down Expand Up @@ -81,6 +83,7 @@ const ReactPage: NextPage = () => {
<TxbuilderSetRequiredSigners />
<TxbuilderSetTime />
<TxbuilderSetNetwork />
<TxbuilderSetFee />
</SidebarFullwidth>
</>
);
Expand Down
29 changes: 29 additions & 0 deletions apps/playground/src/pages/apis/txbuilder/basics/set-fee.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import TwoColumnsScroll from "~/components/sections/two-columns-scroll";
import Codeblock from "~/components/text/codeblock";

export default function TxbuilderSetFee() {
return (
<TwoColumnsScroll sidebarTo="setFee" title="Set Fee" leftSection={Left()} />
);
}

function Left() {
let code1 = ``;
code1 += `const unsignedTx = await txBuilder\n`;
code1 += ` .txOut(...)\n`;
code1 += ` .changeAddress(...)\n`;
code1 += ` .setFee("0")\n`;
code1 += ` .complete();\n`;

return (
<>
<p>Set the fee for the transaction.</p>
<Codeblock data={`.setFee(fee: string)`} />
<p>
The following shows a simple example of building a transaction to send
values with UTxO selection:
</p>
<Codeblock data={code1} />
</>
);
}
41 changes: 28 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.7.22",
"version": "1.7.23",
"description": "Contains constants, types and interfaces used across the SDK and different serialization libraries",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type MeshTxBuilderBody = {
strategy: UtxoSelectionStrategy;
includeTxFees: boolean;
};
fee?: string;
network: Network | number[][];
};

Expand Down
8 changes: 4 additions & 4 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.7.22",
"version": "1.7.23",
"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,9 +34,9 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/common": "1.7.22",
"@meshsdk/core": "1.7.22",
"@meshsdk/core-csl": "1.7.22"
"@meshsdk/common": "1.7.23",
"@meshsdk/core": "1.7.23",
"@meshsdk/core-csl": "1.7.23"
},
"prettier": "@meshsdk/configs/prettier",
"publishConfig": {
Expand Down
10 changes: 5 additions & 5 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.7.22",
"version": "1.7.23",
"description": "Types and utilities functions between Mesh and cardano-serialization-lib",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down Expand Up @@ -31,17 +31,17 @@
},
"devDependencies": {
"@meshsdk/configs": "*",
"@meshsdk/provider": "1.7.22",
"@meshsdk/provider": "1.7.23",
"@types/json-bigint": "^1.0.4",
"eslint": "^8.57.0",
"ts-jest": "^29.1.4",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/common": "1.7.22",
"@sidan-lab/sidan-csl-rs-browser": "0.9.6",
"@sidan-lab/sidan-csl-rs-nodejs": "0.9.6",
"@meshsdk/common": "1.7.23",
"@sidan-lab/sidan-csl-rs-browser": "0.9.7",
"@sidan-lab/sidan-csl-rs-nodejs": "0.9.7",
"@types/base32-encoding": "^1.0.2",
"base32-encoding": "^1.0.0",
"bech32": "^2.0.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/mesh-core-csl/src/core/adaptor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { MeshTxBuilderBody, validityRangeToObj } from "@meshsdk/common";

import { certificateToObj } from "./certificate";
import { mintItemToObj } from "./mint";
import { networkToObj } from "./network";
import { outputToObj } from "./output";
import { collateralTxInToObj, txInToObj } from "./txIn";
import { voteToObj } from "./vote";
import { withdrawalToObj } from "./withdrawal";
import { networkToObj } from "./network";

export const meshTxBuilderBodyToObj = ({
inputs,
Expand All @@ -22,6 +22,7 @@ export const meshTxBuilderBodyToObj = ({
signingKey,
withdrawals,
votes,
fee,
network,
}: MeshTxBuilderBody) => {
return {
Expand All @@ -38,6 +39,7 @@ export const meshTxBuilderBodyToObj = ({
signingKey: signingKey,
withdrawals: withdrawals.map(withdrawalToObj),
votes: votes.map(voteToObj),
fee,
network: networkToObj(network),
};
};
Expand Down
Loading

0 comments on commit 30910bd

Please sign in to comment.