From 74e19c05893cf2ec2486c814c0769a7c589a6c22 Mon Sep 17 00:00:00 2001 From: RetricSu Date: Mon, 21 Oct 2024 13:40:58 +0800 Subject: [PATCH 1/4] fix(examples): small bugs in xudt dapp (#473) --- examples/xudt/index.tsx | 4 ++-- examples/xudt/package.json | 1 + examples/xudt/yarn.lock | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/xudt/index.tsx b/examples/xudt/index.tsx index 5ac25cf12..c9872c49c 100644 --- a/examples/xudt/index.tsx +++ b/examples/xudt/index.tsx @@ -44,7 +44,7 @@ function IssuedToken() { ); } }; - const enabledIssue = +amount > 0 && +balance > 6100000000; + const enabledIssue = +amount > 0 && +balance > 61; return ( <> @@ -93,7 +93,7 @@ function IssuedToken() {
  • Token cell: -

    Capacity: {issuedTokenCell.capacity.toString()}

    +

    Capacity: {ccc.fixedPointToString(issuedTokenCell.capacity)} CKB

    Lock: {JSON.stringify(issuedTokenCell.lock, null, 2)}

    Type: {JSON.stringify(issuedTokenCell.type, null, 2)}

  • diff --git a/examples/xudt/package.json b/examples/xudt/package.json index ba48f9b75..2af50bfba 100644 --- a/examples/xudt/package.json +++ b/examples/xudt/package.json @@ -19,6 +19,7 @@ "devDependencies": { "@types/node": "^20.12.11", "crypto-browserify": "^3.12.0", + "events": "^3.1.0", "parcel": "^2.9.3", "path-browserify": "^1.0.0", "process": "^0.11.10", diff --git a/examples/xudt/yarn.lock b/examples/xudt/yarn.lock index 4a7da119a..369521740 100644 --- a/examples/xudt/yarn.lock +++ b/examples/xudt/yarn.lock @@ -1557,6 +1557,11 @@ event-target-shim@^5.0.0: resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== +events@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" From 58edeb3984ae78dafd968fe07af4f7cbbd8d6200 Mon Sep 17 00:00:00 2001 From: RetricSu Date: Thu, 24 Oct 2024 11:25:05 +0800 Subject: [PATCH 2/4] fix(ccc): use completeInputsByCapacity (#475) --- examples/simple-transfer/lib.ts | 2 +- examples/store-data-on-cell/lib.ts | 2 +- examples/xudt/lib.ts | 2 +- website/docs/dapp/create-token.mdx | 2 +- website/docs/dapp/transfer-ckb.mdx | 2 +- website/docs/dapp/write-message.mdx | 2 +- website/docs/sdk-and-devtool/ccc.mdx | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/simple-transfer/lib.ts b/examples/simple-transfer/lib.ts index 3def435e4..d5969ac36 100644 --- a/examples/simple-transfer/lib.ts +++ b/examples/simple-transfer/lib.ts @@ -49,7 +49,7 @@ export async function transfer( }); // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); const txHash = await signer.sendTransaction(tx); console.log( diff --git a/examples/store-data-on-cell/lib.ts b/examples/store-data-on-cell/lib.ts index 76b090249..e3572f2fe 100644 --- a/examples/store-data-on-cell/lib.ts +++ b/examples/store-data-on-cell/lib.ts @@ -60,7 +60,7 @@ export async function buildMessageTx( }); // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); const txHash = await signer.sendTransaction(tx); alert(`The transaction hash is ${txHash}`); diff --git a/examples/xudt/lib.ts b/examples/xudt/lib.ts index c05ec85f9..f173cc104 100644 --- a/examples/xudt/lib.ts +++ b/examples/xudt/lib.ts @@ -46,7 +46,7 @@ export async function issueToken(privKey: string, amount: string) { // additional 0.001 ckb for tx fee // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); const txHash = await signer.sendTransaction(tx); console.log( diff --git a/website/docs/dapp/create-token.mdx b/website/docs/dapp/create-token.mdx index 3f58be6b2..6f594cebf 100644 --- a/website/docs/dapp/create-token.mdx +++ b/website/docs/dapp/create-token.mdx @@ -102,7 +102,7 @@ Next, to complete our `issueToken` function, we just use the `helpers.Transactio await tx.addCellDepsOfKnownScripts(signer.client, ccc.KnownScript.XUdt); // additional 0.001 ckb for tx fee // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); ... diff --git a/website/docs/dapp/transfer-ckb.mdx b/website/docs/dapp/transfer-ckb.mdx index c9e3f0333..5811653c8 100644 --- a/website/docs/dapp/transfer-ckb.mdx +++ b/website/docs/dapp/transfer-ckb.mdx @@ -126,7 +126,7 @@ Next, we need to complete the inputs of the transaction. //.... // Complete missing parts for transaction -await tx.completeInputsAll(signer); +await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); ``` diff --git a/website/docs/dapp/write-message.mdx b/website/docs/dapp/write-message.mdx index 2968d5b1d..68b503f59 100644 --- a/website/docs/dapp/write-message.mdx +++ b/website/docs/dapp/write-message.mdx @@ -105,7 +105,7 @@ Next, we ask CCC to complete the transaction for us with transaction fee: ```ts // Complete missing parts for transaction -await tx.completeInputsAll(signer); +await tx.completeInputsByCapacity(signer); await tx.completeFeeBy(signer, 1000); ``` diff --git a/website/docs/sdk-and-devtool/ccc.mdx b/website/docs/sdk-and-devtool/ccc.mdx index 681df2d59..662c0adb2 100644 --- a/website/docs/sdk-and-devtool/ccc.mdx +++ b/website/docs/sdk-and-devtool/ccc.mdx @@ -347,7 +347,7 @@ return; }); // Complete missing parts for transaction - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); // Change all balance to the first output await tx.completeFeeChangeToOutput(signer, 0, 1000); const amount = ccc.fixedPointToString(tx.outputs[0].capacity); @@ -1396,7 +1396,7 @@ export default function Transfer() { ccc.KnownScript.NervosDao, ); - await tx.completeInputsAll(signer); + await tx.completeInputsByCapacity(signer); await tx.completeFeeChangeToOutput(signer, 0, 1000); const amount = ccc.fixedPointToString(tx.outputs[0].capacity); From ce07f6ae0862aef719dd3118469bad8b0e9900a6 Mon Sep 17 00:00:00 2001 From: RetricSu Date: Fri, 25 Oct 2024 16:10:44 +0800 Subject: [PATCH 3/4] refactor: rename ckb-ecofund to ckb-devrel (#477) --- examples/README.md | 4 ++-- examples/create-dob/README.md | 2 +- examples/simple-lock/README.md | 2 +- examples/simple-transfer/README.md | 2 +- examples/store-data-on-cell/README.md | 2 +- examples/xudt/README.md | 2 +- website/docs/dapp/TutorialOverview.tsx | 10 +++++----- website/docs/ecosystem/EcoCardContents.tsx | 2 +- website/docs/ecosystem/organizations.md | 2 +- website/docs/getting-started/quick-start.mdx | 2 +- website/docs/integrate-wallets/ccc-wallet.mdx | 8 ++++---- website/docs/script/ScriptHeaders.tsx | 2 +- website/docs/script/sudt-script.mdx | 2 +- website/docs/sdk-and-devtool/CardsContents.tsx | 4 ++-- website/docs/sdk-and-devtool/ccc.mdx | 2 +- website/docs/sdk-and-devtool/cli-tool.mdx | 2 +- website/src/pages/homeContents.tsx | 2 +- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/README.md b/examples/README.md index ce66ce078..a1c677e8d 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,12 +1,12 @@ # Tutorial Examples -The dApp examples are created by [offckb](https://github.com/ckb-ecofund/offckb) templates. You can switch different networks by exporting `NETWORK` env var. +The dApp examples are created by [offckb](https://github.com/ckb-devrel/offckb) templates. You can switch different networks by exporting `NETWORK` env var. ```sh export NETWORK=testnet # or testnet, mainnet ``` -On devnet, use [`offckb`](https://github.com/ckb-ecofund/offckb) to start a local blockchain first: +On devnet, use [`offckb`](https://github.com/ckb-devrel/offckb) to start a local blockchain first: ```sh npm install -g offckb diff --git a/examples/create-dob/README.md b/examples/create-dob/README.md index b91af7a8c..ec189d396 100644 --- a/examples/create-dob/README.md +++ b/examples/create-dob/README.md @@ -20,7 +20,7 @@ yarn start ### On Devnet -Use a CLI tool [`offckb`](https://github.com/ckb-ecofund/offckb) to start a CKB devnet: +Use a CLI tool [`offckb`](https://github.com/ckb-devrel/offckb) to start a CKB devnet: ```sh npm install -g offckb diff --git a/examples/simple-lock/README.md b/examples/simple-lock/README.md index 1b8c9bc32..601347279 100644 --- a/examples/simple-lock/README.md +++ b/examples/simple-lock/README.md @@ -22,7 +22,7 @@ Even though using a hash and preimage is too simple to be a secure Lock Script, ## offckb-template -This is a Minimal Template for CKB Full-Stack Dapps generated by [offckb](https://github.com/ckb-ecofund/offckb). +This is a Minimal Template for CKB Full-Stack Dapps generated by [offckb](https://github.com/ckb-devrel/offckb). Offckb does not do the magic. It just wraps the new CKB smart contract template and the CKB javascript Dapp framework into one mono-repo. Under the hook, it uses: diff --git a/examples/simple-transfer/README.md b/examples/simple-transfer/README.md index de5e32a27..0f376a25e 100644 --- a/examples/simple-transfer/README.md +++ b/examples/simple-transfer/README.md @@ -20,7 +20,7 @@ yarn start ### On Devnet -Use a CLI tool [`offckb`](https://github.com/ckb-ecofund/offckb) to start a CKB devnet: +Use a CLI tool [`offckb`](https://github.com/ckb-devrel/offckb) to start a CKB devnet: ```sh npm install -g offckb diff --git a/examples/store-data-on-cell/README.md b/examples/store-data-on-cell/README.md index f9a8935cc..f60b759df 100644 --- a/examples/store-data-on-cell/README.md +++ b/examples/store-data-on-cell/README.md @@ -22,7 +22,7 @@ yarn start ### On Devnet -Use a CLI tool [`offckb`](https://github.com/ckb-ecofund/offckb) to start a CKB devnet: +Use a CLI tool [`offckb`](https://github.com/ckb-devrel/offckb) to start a CKB devnet: ```sh npm install -g offckb diff --git a/examples/xudt/README.md b/examples/xudt/README.md index a432b28ad..7dc6190be 100644 --- a/examples/xudt/README.md +++ b/examples/xudt/README.md @@ -20,7 +20,7 @@ yarn start ### On Devnet -Use a CLI tool [`offckb`](https://github.com/ckb-ecofund/offckb) to start a CKB devnet: +Use a CLI tool [`offckb`](https://github.com/ckb-devrel/offckb) to start a CKB devnet: ```sh npm install -g offckb diff --git a/website/docs/dapp/TutorialOverview.tsx b/website/docs/dapp/TutorialOverview.tsx index 1853f3349..f3cab499a 100644 --- a/website/docs/dapp/TutorialOverview.tsx +++ b/website/docs/dapp/TutorialOverview.tsx @@ -49,7 +49,7 @@ const TRANSFEROVERVIEW: TutorialHeaderProps = { OffCKB {", version >= "} - + v0.3.0-rc2 , @@ -99,7 +99,7 @@ const WRITEOVERVIEW: TutorialHeaderProps = { OffCKB {", version >= "} - + v0.3.0-rc2 , @@ -152,7 +152,7 @@ const TOKENOVERVIEW: TutorialHeaderProps = { OffCKB {", version >= "} - + v0.3.0-rc2 , @@ -205,7 +205,7 @@ const DOBOVERVIEW: TutorialHeaderProps = { OffCKB {", version >= "} - + v0.3.0-rc2 , @@ -266,7 +266,7 @@ const LOCKOVERVIEW: TutorialHeaderProps = { OffCKB {", version >= "} - + v0.3.0-rc2 , diff --git a/website/docs/ecosystem/EcoCardContents.tsx b/website/docs/ecosystem/EcoCardContents.tsx index c7a538bd7..fc91f5c8d 100644 --- a/website/docs/ecosystem/EcoCardContents.tsx +++ b/website/docs/ecosystem/EcoCardContents.tsx @@ -247,7 +247,7 @@ const ecoCardContents: EcoCardProps[] = [ tags: ["DApp"], links: [ { label: "website", link: "https://www.nervdao.com/" }, - { label: "github", link: "https://github.com/ckb-ecofund/nervdao" }, + { label: "github", link: "https://github.com/ckb-devrel/nervdao" }, ], }, { diff --git a/website/docs/ecosystem/organizations.md b/website/docs/ecosystem/organizations.md index fc8737ce2..7b9d13638 100644 --- a/website/docs/ecosystem/organizations.md +++ b/website/docs/ecosystem/organizations.md @@ -17,4 +17,4 @@ Explore all the organizations and their relevant GitHub repositories within the | Nervina-labs | https://github.com/nervina-labs | JoyID, CoTA | | CKB-JS | https://github.com/ckb-js | Lumos, Kuai, CKB-SDK-JS | | .bit | https://github.com/dotbitHQ | did-contracts , dotbit.js | -| ckb-ecofund | https://github.com/ckb-ecofund | ccc | +| ckb-devrel | https://github.com/ckb-devrel | ccc | diff --git a/website/docs/getting-started/quick-start.mdx b/website/docs/getting-started/quick-start.mdx index 187981d98..2af1e8540 100644 --- a/website/docs/getting-started/quick-start.mdx +++ b/website/docs/getting-started/quick-start.mdx @@ -167,7 +167,7 @@ Once the server is up and running, you can view the dApp by visiting [localhost: The boilerplate project for a full-stack CKB dApp comprises two main components: -- The frontend, which utilizes the CKB JavaScript framework, [CCC](https://github.com/ckb-ecofund/ccc). +- The frontend, which utilizes the CKB JavaScript framework, [CCC](https://github.com/ckb-devrel/ccc). - The Scripts, which leverage the [ckb-script-templates](https://github.com/cryptape/ckb-script-templates). By default, the Next.js template comes with a simple Script `hello-world` under `contracts/hello-world/src/main.rs`. diff --git a/website/docs/integrate-wallets/ccc-wallet.mdx b/website/docs/integrate-wallets/ccc-wallet.mdx index aac105464..db12f300d 100644 --- a/website/docs/integrate-wallets/ccc-wallet.mdx +++ b/website/docs/integrate-wallets/ccc-wallet.mdx @@ -5,7 +5,7 @@ title: "Wallet Connector(CCC)" # All-In-One Wallet Connector(CCC) -[Common Chains Connector (CCC)](https://github.com/ckb-ecofund/ccc) is a new wallet connectivity library developed in Typescript Lang, designed to make it easier for developers to help users connect with multiple ecosystem wallets and manage their assets directly on CKB. +[Common Chains Connector (CCC)](https://github.com/ckb-devrel/ccc) is a new wallet connectivity library developed in Typescript Lang, designed to make it easier for developers to help users connect with multiple ecosystem wallets and manage their assets directly on CKB. What sets CCC apart is its use of CKB’s advanced cryptographic technologies coupled with native account abstraction. This feature fundamentally transforms how users transact and manage their digital assets across different wallets, providing a unified and fluid experience. @@ -58,10 +58,10 @@ registerCustomLockScriptInfos(generateDefaultScriptInfos()); CCC demo - online preview: [https://ckbccc-demo.vercel.app/](https://ckbccc-demo.vercel.app/) -- source code: [https://github.com/ckb-ecofund/ccc/tree/master/packages/demo](https://github.com/ckb-ecofund/ccc/tree/master/packages/demo) +- source code: [https://github.com/ckb-devrel/ccc/tree/master/packages/demo](https://github.com/ckb-devrel/ccc/tree/master/packages/demo) offckb dApp boilerplate also integrated with CCC for wallet connection: - guide: [/docs/getting-started/quick-start#run-the-dapp-project](/docs/getting-started/quick-start#run-the-dapp-project) -- source code: [nextjs](https://github.com/ckb-ecofund/offckb/tree/master/templates/next-js-template/frontend) -- source code: [remix-vite](https://github.com/ckb-ecofund/offckb/tree/master/templates/remix-vite-template/frontend) +- source code: [nextjs](https://github.com/ckb-devrel/offckb/tree/master/templates/next-js-template/frontend) +- source code: [remix-vite](https://github.com/ckb-devrel/offckb/tree/master/templates/remix-vite-template/frontend) diff --git a/website/docs/script/ScriptHeaders.tsx b/website/docs/script/ScriptHeaders.tsx index d73214ca9..22812832c 100644 --- a/website/docs/script/ScriptHeaders.tsx +++ b/website/docs/script/ScriptHeaders.tsx @@ -224,7 +224,7 @@ export const ScriptHeaders: ScriptHeadersType = { tools: [
    diff --git a/website/docs/script/sudt-script.mdx b/website/docs/script/sudt-script.mdx index 81d14164f..63b7164f1 100644 --- a/website/docs/script/sudt-script.mdx +++ b/website/docs/script/sudt-script.mdx @@ -48,7 +48,7 @@ This hash is also used to determine if a transaction is initiated by the token i For a more detailed explanation, please refer to [Create a Fungible Token](/docs/dapp/create-token) or [RFC0025: Simple UDT](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0025-simple-udt/0025-simple-udt.md) -Now, let's create a new project to build the UDT Script. We will use [OFFCKB](https://github.com/ckb-ecofund/offckb) and [ckb-script-templates](https://github.com/cryptape/ckb-script-templates). +Now, let's create a new project to build the UDT Script. We will use [OFFCKB](https://github.com/ckb-devrel/offckb) and [ckb-script-templates](https://github.com/cryptape/ckb-script-templates). ### Initialize a Script Project diff --git a/website/docs/sdk-and-devtool/CardsContents.tsx b/website/docs/sdk-and-devtool/CardsContents.tsx index aacb09401..9b0499915 100644 --- a/website/docs/sdk-and-devtool/CardsContents.tsx +++ b/website/docs/sdk-and-devtool/CardsContents.tsx @@ -18,12 +18,12 @@ const toolCardContents: CardProps[] = [ { title: "OffCKB", description: "CKB local development network for your first try", - link: "https://github.com/ckb-ecofund/offckb/tree/7d87d018be7626e1672a039b52f8bf4db9dd4eae", + link: "https://github.com/ckb-devrel/offckb/tree/7d87d018be7626e1672a039b52f8bf4db9dd4eae", type: "tool", links: [ { label: "Github", - link: "https://github.com/ckb-ecofund/offckb/tree/7d87d018be7626e1672a039b52f8bf4db9dd4eae", + link: "https://github.com/ckb-devrel/offckb/tree/7d87d018be7626e1672a039b52f8bf4db9dd4eae", }, ], }, diff --git a/website/docs/sdk-and-devtool/ccc.mdx b/website/docs/sdk-and-devtool/ccc.mdx index 662c0adb2..bdb46741f 100644 --- a/website/docs/sdk-and-devtool/ccc.mdx +++ b/website/docs/sdk-and-devtool/ccc.mdx @@ -1778,4 +1778,4 @@ return ( - [CCC Demo](https://app.ckbccc.com/) - [CCC Docs](http://docs.ckbccc.com/) -- [CCC Github Repository](https://github.com/ckb-ecofund/ccc) +- [CCC Github Repository](https://github.com/ckb-devrel/ccc) diff --git a/website/docs/sdk-and-devtool/cli-tool.mdx b/website/docs/sdk-and-devtool/cli-tool.mdx index eafd290c1..37d1bb891 100644 --- a/website/docs/sdk-and-devtool/cli-tool.mdx +++ b/website/docs/sdk-and-devtool/cli-tool.mdx @@ -88,7 +88,7 @@ ckb-cli rpc get_live_cell --tx-hash 0x4ec75b5a8de8d180853d5046760a99285c73283a5d ## OffCKB -[offckb](https://github.com/ckb-ecofund/offckb) is a CLI tool developed in Node.js to help you quickly set up a predefined CKB Devnet and create dApp boilerplates. +[offckb](https://github.com/ckb-devrel/offckb) is a CLI tool developed in Node.js to help you quickly set up a predefined CKB Devnet and create dApp boilerplates. If you need a local development environment for the very first try on your dApp, `offckb` is the ideal choice. diff --git a/website/src/pages/homeContents.tsx b/website/src/pages/homeContents.tsx index da3ff2083..8e1a56522 100644 --- a/website/src/pages/homeContents.tsx +++ b/website/src/pages/homeContents.tsx @@ -136,7 +136,7 @@ const devToolSectionContents: DevToolProps[] = [ }, { title: "OffCKB", - href: "https://github.com/ckb-ecofund/offckb/tree/7d87d018be7626e1672a039b52f8bf4db9dd4eae", + href: "https://github.com/ckb-devrel/offckb/tree/7d87d018be7626e1672a039b52f8bf4db9dd4eae", category: "Other DevTools", }, { From 48d9482c0112418bec27c46f9904669fbefdd9ef Mon Sep 17 00:00:00 2001 From: RetricSu Date: Fri, 25 Oct 2024 16:16:05 +0800 Subject: [PATCH 4/4] chore: bump v2.13.0 (#478) --- website/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/package.json b/website/package.json index ece44be42..068b95dfc 100644 --- a/website/package.json +++ b/website/package.json @@ -1,6 +1,6 @@ { "name": "docs.nervos.org", - "version": "2.12.0", + "version": "2.13.0", "description": "Official docs website for Nervos CKB", "license": "MIT", "scripts": {