diff --git a/0-quickstart_transfer/main.ts b/0-quickstart_transfer/main.ts index c556d90..3bcde37 100644 --- a/0-quickstart_transfer/main.ts +++ b/0-quickstart_transfer/main.ts @@ -5,6 +5,7 @@ import { LAMPORTS_PER_SOL, SystemProgram, Transaction, + PublicKey, } from "@solana/web3.js"; import * as anchor from "@coral-xyz/anchor"; import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet"; @@ -13,7 +14,7 @@ import { ClockworkProvider, PAYER_PUBKEY } from "@clockwork-xyz/sdk"; const connection = new Connection("http://localhost:8899", "processed"); const payer = Keypair.fromSecretKey( Buffer.from(JSON.parse(require("fs").readFileSync( - require("os").homedir() + "/.config/solana/id.json", + require("os").homedir() + "/.config/solana/id.json", // double check this path on your machine "utf-8" ))) ); @@ -35,7 +36,12 @@ describe("transfer", async () => { threadId ) + // comment out the line below which generates a random address const recipient = Keypair.generate().publicKey; + + // replace it with this, and add your pubkey: + // const recipient = new PublicKey('YOUR_PUBKEY') + console.log(`🫴 recipient: ${recipient.toString()}\n`); // 1️⃣ Prepare an instruction to be automated. diff --git a/README.md b/README.md index 4d50593..441b871 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # **Clockwork examples** This repo contains example automated smart-contracts built with the [**Clockwork SDK**](https://docs.clockwork.xyz). -- [**0. Quickstart Sol Transfer (Typescript)**](https://github.com/clockwork-xyz/examples/tree/main/0-quickstart_transfer) – Executes an SOL transfer on a user-defined schedule. +- [**0. Quickstart SOL Transfer (Typescript)**](https://github.com/clockwork-xyz/examples/tree/main/0-quickstart_transfer) – Executes a SOL transfer on a user-defined schedule. - [**1. SPL Transfer (Typescript)**](https://github.com/clockwork-xyz/examples/tree/main/1-spl_transfer) – Executes an SPL token transfer on a user-defined schedule. - [**2. Counter**](https://github.com/clockwork-xyz/examples/tree/main/2-counter) – Creates a thread via CPI that increments a counter every 10 seconds -- [**Recurring payments**](https://github.com/clockwork-xyz/examples/tree/main/payments) – Executes an SPL token transfer on a user-defined schedule. -- [**Token distributor**](https://github.com/clockwork-xyz/examples/tree/main/distributor) – Mints a new token and sends it to a target user every 60 seconds. -- [**Dollar cost averaging**](https://github.com/clockwork-xyz/examples/tree/main/investments) – Executes a swap on Serum on a user-defined schedule. -- [**Serum crank**](https://github.com/clockwork-xyz/examples/tree/main/serum_crank) – Indefinitely processes open orders on a permissioned Serum market. -- [**Subscriptions**](https://github.com/clockwork-xyz/examples/tree/main/subscriptions) – Allow users to subscribe to subscriptions by paying on a recurrent schedule. +- [**3. Recurring payments**](https://github.com/clockwork-xyz/examples/tree/main/payments) – Executes an SPL token transfer on a user-defined schedule. +- [**4. Token distributor**](https://github.com/clockwork-xyz/examples/tree/main/distributor) – Mints a new token and sends it to a target user every 60 seconds. +- [**5. Dollar cost averaging**](https://github.com/clockwork-xyz/examples/tree/main/investments) – Executes a swap on Serum on a user-defined schedule. +- [**6. Serum crank**](https://github.com/clockwork-xyz/examples/tree/main/serum_crank) – Indefinitely processes open orders on a permissioned Serum market. +- [**7. Subscriptions**](https://github.com/clockwork-xyz/examples/tree/main/subscriptions) – Allow users to subscribe to subscriptions by paying on a recurrent schedule.