Skip to content

Commit

Permalink
Merge pull request #479 from nervosnetwork/v2
Browse files Browse the repository at this point in the history
feat: merge v2.13.0
  • Loading branch information
RetricSu authored Oct 25, 2024
2 parents 696a502 + 48d9482 commit 7bf1ae4
Show file tree
Hide file tree
Showing 27 changed files with 43 additions and 37 deletions.
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/create-dob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-lock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion examples/simple-transfer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-transfer/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion examples/store-data-on-cell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/store-data-on-cell/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
2 changes: 1 addition & 1 deletion examples/xudt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/xudt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function IssuedToken() {
);
}
};
const enabledIssue = +amount > 0 && +balance > 6100000000;
const enabledIssue = +amount > 0 && +balance > 61;

return (
<>
Expand Down Expand Up @@ -93,7 +93,7 @@ function IssuedToken() {
</li>
<li>
Token cell:
<p>Capacity: {issuedTokenCell.capacity.toString()}</p>
<p>Capacity: {ccc.fixedPointToString(issuedTokenCell.capacity)} CKB</p>
<p>Lock: {JSON.stringify(issuedTokenCell.lock, null, 2)}</p>
<p>Type: {JSON.stringify(issuedTokenCell.type, null, 2)}</p>
</li>
Expand Down
2 changes: 1 addition & 1 deletion examples/xudt/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions examples/xudt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions examples/xudt/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions website/docs/dapp/TutorialOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const TRANSFEROVERVIEW: TutorialHeaderProps = {
OffCKB
</Link>
{", version >= "}
<Link href="https://github.com/ckb-ecofund/offckb/releases/tag/v0.3.0-rc2">
<Link href="https://github.com/ckb-devrel/offckb/releases/tag/v0.3.0-rc2">
v0.3.0-rc2
</Link>
</div>,
Expand Down Expand Up @@ -99,7 +99,7 @@ const WRITEOVERVIEW: TutorialHeaderProps = {
OffCKB
</Link>
{", version >= "}
<Link href="https://github.com/ckb-ecofund/offckb/releases/tag/v0.3.0-rc2">
<Link href="https://github.com/ckb-devrel/offckb/releases/tag/v0.3.0-rc2">
v0.3.0-rc2
</Link>
</div>,
Expand Down Expand Up @@ -152,7 +152,7 @@ const TOKENOVERVIEW: TutorialHeaderProps = {
OffCKB
</Link>
{", version >= "}
<Link href="https://github.com/ckb-ecofund/offckb/releases/tag/v0.3.0-rc2">
<Link href="https://github.com/ckb-devrel/offckb/releases/tag/v0.3.0-rc2">
v0.3.0-rc2
</Link>
</div>,
Expand Down Expand Up @@ -205,7 +205,7 @@ const DOBOVERVIEW: TutorialHeaderProps = {
OffCKB
</Link>
{", version >= "}
<Link href="https://github.com/ckb-ecofund/offckb/releases/tag/v0.3.0-rc2">
<Link href="https://github.com/ckb-devrel/offckb/releases/tag/v0.3.0-rc2">
v0.3.0-rc2
</Link>
</div>,
Expand Down Expand Up @@ -266,7 +266,7 @@ const LOCKOVERVIEW: TutorialHeaderProps = {
OffCKB
</Link>
{", version >= "}
<Link href="https://github.com/ckb-ecofund/offckb/releases/tag/v0.3.0-rc2">
<Link href="https://github.com/ckb-devrel/offckb/releases/tag/v0.3.0-rc2">
v0.3.0-rc2
</Link>
</div>,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/dapp/create-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

...
Expand Down
2 changes: 1 addition & 1 deletion website/docs/dapp/transfer-ckb.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/dapp/write-message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/ecosystem/EcoCardContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion website/docs/ecosystem/organizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
2 changes: 1 addition & 1 deletion website/docs/getting-started/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
8 changes: 4 additions & 4 deletions website/docs/integrate-wallets/ccc-wallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion website/docs/script/ScriptHeaders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export const ScriptHeaders: ScriptHeadersType = {
tools: [
<div>
<a
href="https://github.com/ckb-ecofund/offckb"
href="https://github.com/ckb-devrel/offckb"
target="_blank"
rel="noopener noreferrer"
>
Expand Down
2 changes: 1 addition & 1 deletion website/docs/script/sudt-script.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions website/docs/sdk-and-devtool/CardsContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
},
Expand Down
6 changes: 3 additions & 3 deletions website/docs/sdk-and-devtool/ccc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion website/docs/sdk-and-devtool/cli-tool.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/homeContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
{
Expand Down

0 comments on commit 7bf1ae4

Please sign in to comment.