diff --git a/.changeset/tricky-ties-dream.md b/.changeset/tricky-ties-dream.md new file mode 100644 index 000000000..dffd4771f --- /dev/null +++ b/.changeset/tricky-ties-dream.md @@ -0,0 +1,6 @@ +--- +"@ckb-lumos/common-scripts": minor +"@ckb-lumos/cobuild": minor +--- + +feat: support `SighashAll` and `SighashAllOnly` variant for cobuild diff --git a/.prettierignore b/.prettierignore index 040d78a37..10c619251 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ -**/test_cases.js \ No newline at end of file +**/test_cases.js +**/generated/**/* diff --git a/commitlint.config.js b/commitlint.config.js index 54fecde56..433b72b41 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -23,6 +23,7 @@ const scopeEnumValues = [ "runner", "e2e-test", "molecule", + "cobuild", ]; const Configuration = { extends: ["@commitlint/config-conventional"], diff --git a/examples/cobuild-sighash/README.md b/examples/cobuild-sighash/README.md new file mode 100644 index 000000000..8c5fdb9da --- /dev/null +++ b/examples/cobuild-sighash/README.md @@ -0,0 +1,18 @@ +# CoBuild Sighash Example + +This code example demonstrates how to use `@ckb-lumos/cobuild` with a lock that supports the CoBuild protocol. We will be working with a fake schema for the sUDT script to mint sUDT through a human-readable signing message. + +``` +union SudtActions { + Mint, +} + +table Mint { + to: Script, + amount: Uint128, +} +``` + +## Links + +- [CoBuild](https://talk.nervos.org/t/ckb-transaction-cobuild-protocol-overview/7702) diff --git a/examples/cobuild-sighash/index.html b/examples/cobuild-sighash/index.html new file mode 100644 index 000000000..1cf6194eb --- /dev/null +++ b/examples/cobuild-sighash/index.html @@ -0,0 +1,13 @@ + + + + + + + Lumos with Omni Lock + + +
+ + + \ No newline at end of file diff --git a/examples/cobuild-sighash/index.tsx b/examples/cobuild-sighash/index.tsx new file mode 100644 index 000000000..5018af772 --- /dev/null +++ b/examples/cobuild-sighash/index.tsx @@ -0,0 +1,91 @@ +import React, { useEffect, useState } from "react"; +import ReactDOM from "react-dom"; +import { commons, helpers, Script } from "@ckb-lumos/lumos"; +import { asyncSleep, capacityOf, ethereum, mintSudt } from "./lib"; + +function App() { + const [ethAddr, setEthAddr] = useState(""); + const [omniAddr, setOmniAddr] = useState(""); + const [omniLock, setOmniLock] = useState