From 0266a18e705706e5c67604f9bd2d77d25b01bbdf Mon Sep 17 00:00:00 2001 From: "ALGO Tables (Jeff S.)" <105945985+algotables@users.noreply.github.com> Date: Sat, 11 May 2024 11:53:56 -0700 Subject: [PATCH] Refactor HelloWorldClient instantiation and API calls This commit fixes issues in the HelloWorldClient setup and its interaction with the Algorand blockchain: - Modified the HelloWorldClient constructor to correctly include algod client and adjust the creatorAddress to use deployer.addr, aligning with AlgoKit's requirements for typed clients. - Corrected the createApplication method call to remove an erroneous additional 'create.' prefix and ensured proper parameters in the helloWorld method. - Replaced placeholder 'YOUR_NAME' with 'Jeff' in the helloWorld method call for practical testing. These changes ensure that the client is initialized correctly and interacts with the Algorand blockchain as intended. --- challenge/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/challenge/index.ts b/challenge/index.ts index c9649b1..c35be33 100644 --- a/challenge/index.ts +++ b/challenge/index.ts @@ -19,14 +19,14 @@ const appClient = new HelloWorldClient( resolveBy: 'creatorAndName', findExistingUsing: indexer, sender: deployer, - creatorAddress: deployer, + creatorAddress: deployer.addr, }, - indexer, + algod, ) await appClient.create.createApplication({}); // TODO: change YOUR_NAME to your name or nickname -const result = await appClient.helloWorld({name: "YOUR_NAME"}, {sendParams: {suppressLog: true}}) +const result = await appClient.helloWorld({name: "Jeff"}, {sendParams: {suppressLog: true}}) -console.log(result.return) \ No newline at end of file +console.log(result.return)