From c14403e7ef6b93697dfec5ed7d752db4e3ab45cb Mon Sep 17 00:00:00 2001 From: Akash Rajan Date: Wed, 31 Jul 2024 09:30:57 -0500 Subject: [PATCH] Feat: Improve create sub example --- sns-book/src/domain-name/subdomains/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sns-book/src/domain-name/subdomains/README.md b/sns-book/src/domain-name/subdomains/README.md index 00a122a..74d3196 100644 --- a/sns-book/src/domain-name/subdomains/README.md +++ b/sns-book/src/domain-name/subdomains/README.md @@ -16,6 +16,7 @@ This code snippet creates a subdomain and its reverse lookup account: ```js import { createSubdomain } from "@bonfida/spl-name-service"; +import { TransactionInstruction } from "@solana/web3.js"; // The subdomain to create with or without .sol e.g something.bonfida.sol or something.bonfida const subdomain = "something.bonfida.sol"; @@ -23,7 +24,11 @@ const subdomain = "something.bonfida.sol"; // The owner of the parent domain const owner = new PublicKey("..."); -const ix = createSubdomain(connection, subdomain, owner); +const instructions: TransactionInstuction[] = []; + +const [, ix] = await createSubdomain(connection, subdomain, owner); + +instructions.push(...ix); // Sign and send the tx... ```