diff --git a/README.md b/README.md index 0845199a2..a553d7c46 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,13 @@ SygmaSDK typedocs
-A Typescript SDK allowing users to easily add cross-chain capabilities such as bridging tokens and sending messages to their dApp projects. +The Sygma SDK is written in TypeScript and allows developers to easily add cross-chain capabilities such as bridging tokens and sending messages to their dApp projects. For complete documentation, please see our [docs site](https://docs.buildwithsygma.com). ## Features Currently supported: - Transfering fungible assets between **Substrate** and **EVM** chains +- Generic message passing between **EVM** chains ## Installation ```bash @@ -34,11 +35,11 @@ yarn add @buildwithsygma/sygma-sdk-core ## Example -For examples of usage go the [`examples`](./examples/) folder +For examples of usage, go to the [`examples`](./examples/) folder ## Contracts -For interacting directly with the contracts use the `@buildwithsygma/sygma-contracts` package. +For interacting directly with the contracts, use the `@buildwithsygma/sygma-contracts` package. ## Support diff --git a/examples/evm-to-evm-fungible-transfer/README.md b/examples/evm-to-evm-fungible-transfer/README.md index 7b4c63c3c..5bd8e6ca2 100644 --- a/examples/evm-to-evm-fungible-transfer/README.md +++ b/examples/evm-to-evm-fungible-transfer/README.md @@ -1,14 +1,17 @@ ## Sygma SDK ERC20 Example -This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases an ERC20 token transfer between two networks using the Sygma SDK. +This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases an ERC20 token transfer between the same account on two different testnets using the Sygma SDK. ## Prerequisites Before running the script, ensure that you have the following: -- Node.js installed on your machine -- [Yarn](https://yarnpkg.com/) (version 3.4.1 or higher) -- Access to an Ethereum provider +- Node.js +- Yarn (version 3.4.1 or higher) +- A development wallet funded with `ERC20LRTest` tokens from the [Sygma faucet](https://faucet-ui-stage.buildwithsygma.com/) +- The [exported private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) of your development wallet +- [Goerli ETH](https://goerlifaucet.com/) for gas +- An Ethereum [provider](https://www.infura.io/) (in case the hardcoded RPC within the script does not work) ## Getting started @@ -63,7 +66,7 @@ yarn run transfer The example will use `ethers` in conjuction with the sygma-sdk to create a transfer from `Goerli` to `Sepolia` with a test ERC20 token. -Replace the placeholder values in the script with your own Ethereum wallet private key and provider URL. +Replace the placeholder values in the `.env` file with your own Ethereum wallet private key. ## Script Functionality @@ -76,7 +79,3 @@ This example script performs the following steps: - Retrieves the fee required for the transfer from the SDK. - Builds the necessary approval transactions for the transfer and sends them using the Ethereum wallet. The approval transactions are required to authorize the transfer of ERC20 tokens. - Builds the final transfer transaction and sends it using the Ethereum wallet. - -## Faucet - -To get the test tokens needed for the transfer go to: `https://faucet-ui-stage.buildwithsygma.com/`. \ No newline at end of file diff --git a/examples/evm-to-evm-generic-mesage-passing/README.md b/examples/evm-to-evm-generic-mesage-passing/README.md index 2f2be5b5c..36611975f 100644 --- a/examples/evm-to-evm-generic-mesage-passing/README.md +++ b/examples/evm-to-evm-generic-mesage-passing/README.md @@ -7,8 +7,10 @@ This is an example script that demonstrates the functionality of the SDK using t Before running the script, ensure that you have the following: - Node.js installed on your machine -- [Yarn](https://yarnpkg.com/) (version 3.4.1 or higher) -- Access to an Ethereum provider +- Yarn (version 3.4.1 or higher) +- A development wallet funded with [Sepolia ETH](https://sepolia-faucet.pk910.de/) for gas +- The [exported private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) of your development wallet +- An Ethereum [provider](https://www.infura.io/) (in case the hardcoded RPC within the script does not work) ## Getting started @@ -39,7 +41,22 @@ yarn sdk:build ## Usage -To call a function on a destination chain contract: +This example uses the `dotenv` module to manage private keys. To run the example, you will need to configure your environment variable to include your test development account's [exported private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key). A `.env.sample` is provided as a template. + +**DO NOT COMMIT PRIVATE KEYS WITH REAL FUNDS TO GITHUB. DOING SO COULD RESULT IN COMPLETE LOSS OF YOUR FUNDS.** + +Create a `.env` file in the evm-to-evm GMP example folder: + +```bash +cd examples/evm-to-evm-generic-mesage-passing +touch .env +``` + +Replace between the quotation marks your exported private key: + +`PRIVATE_KEY="YOUR_PRIVATE_KEY_HERE"` + +To call the function on the destination chain contract, `cd` into the example folder `examples/evm-to-evm-generic-mesage-passing` and run: ```bash yarn run transfer @@ -48,7 +65,7 @@ yarn run transfer The example will use `ethers` in conjuction with the sygma-sdk to call a function on a smart contract on `Goerli` by calling the Deposit method on `Sepolia` and passing the details of the function to be called. -Replace the placeholder values in the `.env` file with your own Ethereum wallet private key and provider URL. +Replace the placeholder values in the `.env` file with your own Ethereum wallet private key. ## Script Functionality diff --git a/examples/evm-to-substrate-fungible-transfer/README.md b/examples/evm-to-substrate-fungible-transfer/README.md index 68a64d2f1..e6982adcf 100644 --- a/examples/evm-to-substrate-fungible-transfer/README.md +++ b/examples/evm-to-substrate-fungible-transfer/README.md @@ -1,14 +1,18 @@ ## Sygma SDK ERC20 Example -This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases an ERC20 token transfer between two networks using the Sygma SDK. +This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases an ERC20 token transfer between an EVM network and a Substrate network using the Sygma SDK. ## Prerequisites Before running the script, ensure that you have the following: - Node.js installed on your machine -- [Yarn](https://yarnpkg.com/) (version 3.4.1 or higher) -- Access to an Ethereum provider +- Yarn (version 3.4.1 or higher) +- A development wallet funded with `gPHA` tokens from the [Sygma faucet](https://faucet-ui-stage.buildwithsygma.com/) +- The [exported private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) of your development wallet +- A Substrate wallet to receive tokens into (the example presets an existing wallet address already) +- [Goerli ETH](https://goerlifaucet.com/) for gas +- An Ethereum [provider](https://www.infura.io/) (in case the hardcoded RPC within the script does not work) ## Getting started @@ -63,7 +67,7 @@ yarn run transfer The example will use `ethers` in conjuction with the sygma-sdk to create a transfer from `Goerli` to `Rococo-Phala` with a GPHA token. -Replace the placeholder values in the script with your own Ethereum wallet private key and provider URL. +Replace the placeholder values in the `.env` file with your own Ethereum wallet private key, and your own destination Substrate address within the script. ## Script Functionality @@ -77,8 +81,3 @@ This example script performs the following steps: - Retrieves the fee required for the transfer from the SDK. - Builds the necessary approval transactions for the transfer and sends them using the Ethereum wallet. The approval transactions are required to authorize the transfer of ERC20 tokens. - Builds the final transfer transaction and sends it using the Ethereum wallet. - -## Faucet - -To get the test tokens needed for the transfer go to: `https://faucet-ui-stage.buildwithsygma.com/`. -Get the `GPHA` test token from the faucet. diff --git a/examples/substrate-to-evm-fungible-transfer/README.md b/examples/substrate-to-evm-fungible-transfer/README.md index 18e447ba0..94615452a 100644 --- a/examples/substrate-to-evm-fungible-transfer/README.md +++ b/examples/substrate-to-evm-fungible-transfer/README.md @@ -1,14 +1,17 @@ ## Sygma SDK Substrate Asset Transfer Example -This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases a Substrate Asset transfer between Substrate and EVM using the Sygma SDK. +This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases a Substrate Asset transfer between a Substrate network and an EVM network using the Sygma SDK. ## Prerequisites Before running the script, ensure that you have the following: - Node.js installed on your machine -- [Yarn](https://yarnpkg.com/) (version 3.4.1 or higher) -- Access to a Substrate node +- Yarn (version 3.4.1 or higher) +- A Substrate development wallet funded with `PHA` tokens; **you may wish** to run the [EVM-to-Substrate example](../evm-to-substrate-fungible-transfer/) first to preload `PHA` tokens into a Substrate wallet +- The 12-word mnemonic for your Substrate development wallet +- An Ethereum wallet to receive tokens into (the example presets an existing wallet address already) +- A Substrate provider (in case the hardcoded WSS within the script does not work) ## Getting started @@ -63,7 +66,7 @@ yarn run transfer The example will use `@polkadot/keyring` in conjuction with the sygma-sdk to create a transfer from `Roccoco Phala` to `Goerli`. -Replace the placeholder values in the script with your own Substrate wallet mnemonic and destination EVM address. +Replace the placeholder values in the `.env` file with your own Substrate wallet mnemonic, and your own destination EVM address within the script. ## Script Functionality