From 8318a2c736acee97b1c117e1731d2ae91742825b Mon Sep 17 00:00:00 2001 From: Tanner McMullen <94848716+ilovespectra@users.noreply.github.com> Date: Fri, 9 Jun 2023 07:55:21 -0600 Subject: [PATCH 1/4] Update README.md smol typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d50593..cd95e56 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # **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. From 5cf11fefc86007ae19b97dffe6453b9616a35433 Mon Sep 17 00:00:00 2001 From: Tanner McMullen <94848716+ilovespectra@users.noreply.github.com> Date: Fri, 9 Jun 2023 07:56:04 -0600 Subject: [PATCH 2/4] Update README.md lidl things --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd95e56..a01e7b6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # **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 a 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. From 64f0837a7350f3e20606a470b28175644baea274 Mon Sep 17 00:00:00 2001 From: Tanner McMullen <94848716+ilovespectra@users.noreply.github.com> Date: Fri, 9 Jun 2023 07:56:39 -0600 Subject: [PATCH 3/4] Update README.md continuity --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a01e7b6..441b871 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ This repo contains example automated smart-contracts built with the [**Clockwork - [**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. From 195d3ddce4c57084f9a37d472f257559bfc4ae4d Mon Sep 17 00:00:00 2001 From: Tanner McMullen <94848716+ilovespectra@users.noreply.github.com> Date: Fri, 9 Jun 2023 12:15:39 -0600 Subject: [PATCH 4/4] halp --- 0-quickstart_transfer/main.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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.