From 7ca996da237c7c2cfaf7b55235c430f9489cc603 Mon Sep 17 00:00:00 2001 From: 0x74h51N Date: Wed, 5 Feb 2025 15:27:22 +0300 Subject: [PATCH 1/2] sdk: docs improvement --- packages/sdk/README.md | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/packages/sdk/README.md b/packages/sdk/README.md index 01f89b4d4..de8c1e42c 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -16,8 +16,8 @@ Colony SDK also includes a variety of examples to get you up and building with C ## Quickstart ```javascript -import { providers } from 'ethers'; -import { ColonyNetwork, toEth } from '@colony/sdk'; +import { providers } from "ethers"; +import { ColonyNetwork, toEth } from "@colony/sdk"; // If MetaMask is installed there will be an `ethereum` object on the `window` // NOTE: Make sure MetaMask is connected to ArbitrumOne chain (use https://app.colony.io/public-rpc or see https://chainlist.org/chain/42161) @@ -26,7 +26,7 @@ const provider = new providers.Web3Provider(window.ethereum); // Get the MetaColony's CLNY funding in the root team (id 1) const start = async () => { // This will try to connect the page to MetaMask - await provider.send('eth_requestAccounts', []); + await provider.send("eth_requestAccounts", []); // Create a new connection to the Colony Network contracts using the MetaMask "wallet" const colonyNetwork = new ColonyNetwork(provider.getSigner()); // Connect to the MetaColony (this could be replaced with your own colony using `colonyNetwork.getColony(COLONY_ADDRESS)`) @@ -34,7 +34,7 @@ const start = async () => { // Get the CLNY funding for the MetaColony (CLNY is it's native token) const funding = await metaColony.getBalance(); // The funding will be in wei (x * 10^18), so we format into a readable string using the `toEth` function - alert('MetaColony balance is ' + toEth(funding) + ' CLNY'); + alert("MetaColony balance is " + toEth(funding) + " CLNY"); }; start(); @@ -48,22 +48,34 @@ start(); We are using the [pnpm](https://pnpm.io/installation) version manager for this project. Please make sure to have a current version of it installed on your system. -First, clone this repo: +First, clone this repo: + ```bash git clone https://github.com/JoinColony/colonyJS.git ``` -Go to the `sdk` package directory: +Go to the `root` directory: ```bash -cd colonyJS/packages/sdk +cd colonyJS ``` -Then install all the required dependencies (this will install [ethers.js](https://docs.ethers.io/v5/) and [colonyJS](https://github.com/JoinColony/colonyJS) as well as some required development dependencies): +Run the bootstrap command to install dependencies, build the contractor package, and ensure frozen lockfile integrity: ```bash pnpm bootstrap -pnpm install +``` + +Build the Colony packages (this will build all packages and also install [ethers.js](https://docs.ethers.io/v5/) along with some required development dependencies): + +```bash +pnpm build +``` + +Go to the `sdk` package directory: + +```bash +cd packages/sdk ``` Then you can run the examples: From e6a3d6597c1935c5639f7d9c5421a1128ac66e0b Mon Sep 17 00:00:00 2001 From: 0x74h51N Date: Wed, 5 Feb 2025 15:28:57 +0300 Subject: [PATCH 2/2] changeset for docs imrpvement --- .changeset/wise-dragons-poke.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wise-dragons-poke.md diff --git a/.changeset/wise-dragons-poke.md b/.changeset/wise-dragons-poke.md new file mode 100644 index 000000000..b5284123c --- /dev/null +++ b/.changeset/wise-dragons-poke.md @@ -0,0 +1,5 @@ +--- +"@colony/sdk": major +--- + +Docs improvement for run