Browse Source

Improve Kinobi IDL

Loris Leiva 1 year ago
parent
commit
18f64a8830

+ 1 - 0
clients/js/src/generated/index.ts

@@ -9,5 +9,6 @@
 export * from './accounts';
 export * from './errors';
 export * from './instructions';
+export * from './pdas';
 export * from './programs';
 export * from './types';

+ 117 - 5
clients/js/src/generated/instructions/createAssociatedToken.ts

@@ -17,8 +17,13 @@ import {
   WritableAccount,
   WritableSignerAccount,
 } from '@solana/web3.js';
+import { findAssociatedTokenPda } from '../pdas';
 import { ASSOCIATED_TOKEN_PROGRAM_ADDRESS } from '../programs';
-import { ResolvedAccount, getAccountMetaFactory } from '../shared';
+import {
+  ResolvedAccount,
+  expectAddress,
+  getAccountMetaFactory,
+} from '../shared';
 
 export type CreateAssociatedTokenInstruction<
   TProgram extends string = typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
@@ -57,6 +62,113 @@ export type CreateAssociatedTokenInstruction<
     ]
   >;
 
+export type CreateAssociatedTokenAsyncInput<
+  TAccountPayer extends string = string,
+  TAccountAta extends string = string,
+  TAccountOwner extends string = string,
+  TAccountMint extends string = string,
+  TAccountSystemProgram extends string = string,
+  TAccountTokenProgram extends string = string,
+> = {
+  /** Funding account (must be a system account). */
+  payer: TransactionSigner<TAccountPayer>;
+  /** Associated token account address to be created. */
+  ata?: Address<TAccountAta>;
+  /** Wallet address for the new associated token account. */
+  owner: Address<TAccountOwner>;
+  /** The token mint for the new associated token account. */
+  mint: Address<TAccountMint>;
+  /** System program. */
+  systemProgram?: Address<TAccountSystemProgram>;
+  /** SPL Token program. */
+  tokenProgram?: Address<TAccountTokenProgram>;
+};
+
+export async function getCreateAssociatedTokenInstructionAsync<
+  TAccountPayer extends string,
+  TAccountAta extends string,
+  TAccountOwner extends string,
+  TAccountMint extends string,
+  TAccountSystemProgram extends string,
+  TAccountTokenProgram extends string,
+>(
+  input: CreateAssociatedTokenAsyncInput<
+    TAccountPayer,
+    TAccountAta,
+    TAccountOwner,
+    TAccountMint,
+    TAccountSystemProgram,
+    TAccountTokenProgram
+  >
+): Promise<
+  CreateAssociatedTokenInstruction<
+    typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
+    TAccountPayer,
+    TAccountAta,
+    TAccountOwner,
+    TAccountMint,
+    TAccountSystemProgram,
+    TAccountTokenProgram
+  >
+> {
+  // Program address.
+  const programAddress = ASSOCIATED_TOKEN_PROGRAM_ADDRESS;
+
+  // Original accounts.
+  const originalAccounts = {
+    payer: { value: input.payer ?? null, isWritable: true },
+    ata: { value: input.ata ?? null, isWritable: true },
+    owner: { value: input.owner ?? null, isWritable: false },
+    mint: { value: input.mint ?? null, isWritable: false },
+    systemProgram: { value: input.systemProgram ?? null, isWritable: false },
+    tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
+  };
+  const accounts = originalAccounts as Record<
+    keyof typeof originalAccounts,
+    ResolvedAccount
+  >;
+
+  // Resolve default values.
+  if (!accounts.tokenProgram.value) {
+    accounts.tokenProgram.value =
+      'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;
+  }
+  if (!accounts.ata.value) {
+    accounts.ata.value = await findAssociatedTokenPda({
+      owner: expectAddress(accounts.owner.value),
+      tokenProgram: expectAddress(accounts.tokenProgram.value),
+      mint: expectAddress(accounts.mint.value),
+    });
+  }
+  if (!accounts.systemProgram.value) {
+    accounts.systemProgram.value =
+      '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
+  }
+
+  const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
+  const instruction = {
+    accounts: [
+      getAccountMeta(accounts.payer),
+      getAccountMeta(accounts.ata),
+      getAccountMeta(accounts.owner),
+      getAccountMeta(accounts.mint),
+      getAccountMeta(accounts.systemProgram),
+      getAccountMeta(accounts.tokenProgram),
+    ],
+    programAddress,
+  } as CreateAssociatedTokenInstruction<
+    typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
+    TAccountPayer,
+    TAccountAta,
+    TAccountOwner,
+    TAccountMint,
+    TAccountSystemProgram,
+    TAccountTokenProgram
+  >;
+
+  return instruction;
+}
+
 export type CreateAssociatedTokenInput<
   TAccountPayer extends string = string,
   TAccountAta extends string = string,
@@ -122,14 +234,14 @@ export function getCreateAssociatedTokenInstruction<
   >;
 
   // Resolve default values.
-  if (!accounts.systemProgram.value) {
-    accounts.systemProgram.value =
-      '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
-  }
   if (!accounts.tokenProgram.value) {
     accounts.tokenProgram.value =
       'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;
   }
+  if (!accounts.systemProgram.value) {
+    accounts.systemProgram.value =
+      '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
+  }
 
   const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
   const instruction = {

+ 117 - 5
clients/js/src/generated/instructions/createAssociatedTokenIdempotent.ts

@@ -17,8 +17,13 @@ import {
   WritableAccount,
   WritableSignerAccount,
 } from '@solana/web3.js';
+import { findAssociatedTokenPda } from '../pdas';
 import { ASSOCIATED_TOKEN_PROGRAM_ADDRESS } from '../programs';
-import { ResolvedAccount, getAccountMetaFactory } from '../shared';
+import {
+  ResolvedAccount,
+  expectAddress,
+  getAccountMetaFactory,
+} from '../shared';
 
 export type CreateAssociatedTokenIdempotentInstruction<
   TProgram extends string = typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
@@ -57,6 +62,113 @@ export type CreateAssociatedTokenIdempotentInstruction<
     ]
   >;
 
+export type CreateAssociatedTokenIdempotentAsyncInput<
+  TAccountPayer extends string = string,
+  TAccountAta extends string = string,
+  TAccountOwner extends string = string,
+  TAccountMint extends string = string,
+  TAccountSystemProgram extends string = string,
+  TAccountTokenProgram extends string = string,
+> = {
+  /** Funding account (must be a system account). */
+  payer: TransactionSigner<TAccountPayer>;
+  /** Associated token account address to be created. */
+  ata?: Address<TAccountAta>;
+  /** Wallet address for the new associated token account. */
+  owner: Address<TAccountOwner>;
+  /** The token mint for the new associated token account. */
+  mint: Address<TAccountMint>;
+  /** System program. */
+  systemProgram?: Address<TAccountSystemProgram>;
+  /** SPL Token program. */
+  tokenProgram?: Address<TAccountTokenProgram>;
+};
+
+export async function getCreateAssociatedTokenIdempotentInstructionAsync<
+  TAccountPayer extends string,
+  TAccountAta extends string,
+  TAccountOwner extends string,
+  TAccountMint extends string,
+  TAccountSystemProgram extends string,
+  TAccountTokenProgram extends string,
+>(
+  input: CreateAssociatedTokenIdempotentAsyncInput<
+    TAccountPayer,
+    TAccountAta,
+    TAccountOwner,
+    TAccountMint,
+    TAccountSystemProgram,
+    TAccountTokenProgram
+  >
+): Promise<
+  CreateAssociatedTokenIdempotentInstruction<
+    typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
+    TAccountPayer,
+    TAccountAta,
+    TAccountOwner,
+    TAccountMint,
+    TAccountSystemProgram,
+    TAccountTokenProgram
+  >
+> {
+  // Program address.
+  const programAddress = ASSOCIATED_TOKEN_PROGRAM_ADDRESS;
+
+  // Original accounts.
+  const originalAccounts = {
+    payer: { value: input.payer ?? null, isWritable: true },
+    ata: { value: input.ata ?? null, isWritable: true },
+    owner: { value: input.owner ?? null, isWritable: false },
+    mint: { value: input.mint ?? null, isWritable: false },
+    systemProgram: { value: input.systemProgram ?? null, isWritable: false },
+    tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
+  };
+  const accounts = originalAccounts as Record<
+    keyof typeof originalAccounts,
+    ResolvedAccount
+  >;
+
+  // Resolve default values.
+  if (!accounts.tokenProgram.value) {
+    accounts.tokenProgram.value =
+      'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;
+  }
+  if (!accounts.ata.value) {
+    accounts.ata.value = await findAssociatedTokenPda({
+      owner: expectAddress(accounts.owner.value),
+      tokenProgram: expectAddress(accounts.tokenProgram.value),
+      mint: expectAddress(accounts.mint.value),
+    });
+  }
+  if (!accounts.systemProgram.value) {
+    accounts.systemProgram.value =
+      '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
+  }
+
+  const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
+  const instruction = {
+    accounts: [
+      getAccountMeta(accounts.payer),
+      getAccountMeta(accounts.ata),
+      getAccountMeta(accounts.owner),
+      getAccountMeta(accounts.mint),
+      getAccountMeta(accounts.systemProgram),
+      getAccountMeta(accounts.tokenProgram),
+    ],
+    programAddress,
+  } as CreateAssociatedTokenIdempotentInstruction<
+    typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
+    TAccountPayer,
+    TAccountAta,
+    TAccountOwner,
+    TAccountMint,
+    TAccountSystemProgram,
+    TAccountTokenProgram
+  >;
+
+  return instruction;
+}
+
 export type CreateAssociatedTokenIdempotentInput<
   TAccountPayer extends string = string,
   TAccountAta extends string = string,
@@ -122,14 +234,14 @@ export function getCreateAssociatedTokenIdempotentInstruction<
   >;
 
   // Resolve default values.
-  if (!accounts.systemProgram.value) {
-    accounts.systemProgram.value =
-      '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
-  }
   if (!accounts.tokenProgram.value) {
     accounts.tokenProgram.value =
       'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;
   }
+  if (!accounts.systemProgram.value) {
+    accounts.systemProgram.value =
+      '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
+  }
 
   const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
   const instruction = {

+ 151 - 1
clients/js/src/generated/instructions/recoverNestedAssociatedToken.ts

@@ -17,8 +17,13 @@ import {
   WritableAccount,
   WritableSignerAccount,
 } from '@solana/web3.js';
+import { findAssociatedTokenPda } from '../pdas';
 import { ASSOCIATED_TOKEN_PROGRAM_ADDRESS } from '../programs';
-import { ResolvedAccount, getAccountMetaFactory } from '../shared';
+import {
+  ResolvedAccount,
+  expectAddress,
+  getAccountMetaFactory,
+} from '../shared';
 
 export type RecoverNestedAssociatedTokenInstruction<
   TProgram extends string = typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
@@ -67,6 +72,151 @@ export type RecoverNestedAssociatedTokenInstruction<
     ]
   >;
 
+export type RecoverNestedAssociatedTokenAsyncInput<
+  TAccountNestedAssociatedAccountAddress extends string = string,
+  TAccountNestedTokenMintAddress extends string = string,
+  TAccountDestinationAssociatedAccountAddress extends string = string,
+  TAccountOwnerAssociatedAccountAddress extends string = string,
+  TAccountOwnerTokenMintAddress extends string = string,
+  TAccountWalletAddress extends string = string,
+  TAccountTokenProgram extends string = string,
+> = {
+  /** Nested associated token account, must be owned by `ownerAssociatedAccountAddress`. */
+  nestedAssociatedAccountAddress?: Address<TAccountNestedAssociatedAccountAddress>;
+  /** Token mint for the nested associated token account. */
+  nestedTokenMintAddress: Address<TAccountNestedTokenMintAddress>;
+  /** Wallet's associated token account. */
+  destinationAssociatedAccountAddress?: Address<TAccountDestinationAssociatedAccountAddress>;
+  /** Owner associated token account address, must be owned by `walletAddress`. */
+  ownerAssociatedAccountAddress?: Address<TAccountOwnerAssociatedAccountAddress>;
+  /** Token mint for the owner associated token account. */
+  ownerTokenMintAddress: Address<TAccountOwnerTokenMintAddress>;
+  /** Wallet address for the owner associated token account. */
+  walletAddress: TransactionSigner<TAccountWalletAddress>;
+  /** SPL Token program. */
+  tokenProgram?: Address<TAccountTokenProgram>;
+};
+
+export async function getRecoverNestedAssociatedTokenInstructionAsync<
+  TAccountNestedAssociatedAccountAddress extends string,
+  TAccountNestedTokenMintAddress extends string,
+  TAccountDestinationAssociatedAccountAddress extends string,
+  TAccountOwnerAssociatedAccountAddress extends string,
+  TAccountOwnerTokenMintAddress extends string,
+  TAccountWalletAddress extends string,
+  TAccountTokenProgram extends string,
+>(
+  input: RecoverNestedAssociatedTokenAsyncInput<
+    TAccountNestedAssociatedAccountAddress,
+    TAccountNestedTokenMintAddress,
+    TAccountDestinationAssociatedAccountAddress,
+    TAccountOwnerAssociatedAccountAddress,
+    TAccountOwnerTokenMintAddress,
+    TAccountWalletAddress,
+    TAccountTokenProgram
+  >
+): Promise<
+  RecoverNestedAssociatedTokenInstruction<
+    typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
+    TAccountNestedAssociatedAccountAddress,
+    TAccountNestedTokenMintAddress,
+    TAccountDestinationAssociatedAccountAddress,
+    TAccountOwnerAssociatedAccountAddress,
+    TAccountOwnerTokenMintAddress,
+    TAccountWalletAddress,
+    TAccountTokenProgram
+  >
+> {
+  // Program address.
+  const programAddress = ASSOCIATED_TOKEN_PROGRAM_ADDRESS;
+
+  // Original accounts.
+  const originalAccounts = {
+    nestedAssociatedAccountAddress: {
+      value: input.nestedAssociatedAccountAddress ?? null,
+      isWritable: true,
+    },
+    nestedTokenMintAddress: {
+      value: input.nestedTokenMintAddress ?? null,
+      isWritable: false,
+    },
+    destinationAssociatedAccountAddress: {
+      value: input.destinationAssociatedAccountAddress ?? null,
+      isWritable: true,
+    },
+    ownerAssociatedAccountAddress: {
+      value: input.ownerAssociatedAccountAddress ?? null,
+      isWritable: false,
+    },
+    ownerTokenMintAddress: {
+      value: input.ownerTokenMintAddress ?? null,
+      isWritable: false,
+    },
+    walletAddress: { value: input.walletAddress ?? null, isWritable: true },
+    tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
+  };
+  const accounts = originalAccounts as Record<
+    keyof typeof originalAccounts,
+    ResolvedAccount
+  >;
+
+  // Resolve default values.
+  if (!accounts.tokenProgram.value) {
+    accounts.tokenProgram.value =
+      'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;
+  }
+  if (!accounts.ownerAssociatedAccountAddress.value) {
+    accounts.ownerAssociatedAccountAddress.value = await findAssociatedTokenPda(
+      {
+        owner: expectAddress(accounts.walletAddress.value),
+        tokenProgram: expectAddress(accounts.tokenProgram.value),
+        mint: expectAddress(accounts.ownerTokenMintAddress.value),
+      }
+    );
+  }
+  if (!accounts.nestedAssociatedAccountAddress.value) {
+    accounts.nestedAssociatedAccountAddress.value =
+      await findAssociatedTokenPda({
+        owner: expectAddress(accounts.ownerAssociatedAccountAddress.value),
+        tokenProgram: expectAddress(accounts.tokenProgram.value),
+        mint: expectAddress(accounts.nestedTokenMintAddress.value),
+      });
+  }
+  if (!accounts.destinationAssociatedAccountAddress.value) {
+    accounts.destinationAssociatedAccountAddress.value =
+      await findAssociatedTokenPda({
+        owner: expectAddress(accounts.walletAddress.value),
+        tokenProgram: expectAddress(accounts.tokenProgram.value),
+        mint: expectAddress(accounts.nestedTokenMintAddress.value),
+      });
+  }
+
+  const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
+  const instruction = {
+    accounts: [
+      getAccountMeta(accounts.nestedAssociatedAccountAddress),
+      getAccountMeta(accounts.nestedTokenMintAddress),
+      getAccountMeta(accounts.destinationAssociatedAccountAddress),
+      getAccountMeta(accounts.ownerAssociatedAccountAddress),
+      getAccountMeta(accounts.ownerTokenMintAddress),
+      getAccountMeta(accounts.walletAddress),
+      getAccountMeta(accounts.tokenProgram),
+    ],
+    programAddress,
+  } as RecoverNestedAssociatedTokenInstruction<
+    typeof ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
+    TAccountNestedAssociatedAccountAddress,
+    TAccountNestedTokenMintAddress,
+    TAccountDestinationAssociatedAccountAddress,
+    TAccountOwnerAssociatedAccountAddress,
+    TAccountOwnerTokenMintAddress,
+    TAccountWalletAddress,
+    TAccountTokenProgram
+  >;
+
+  return instruction;
+}
+
 export type RecoverNestedAssociatedTokenInput<
   TAccountNestedAssociatedAccountAddress extends string = string,
   TAccountNestedTokenMintAddress extends string = string,

+ 40 - 0
clients/js/src/generated/pdas/associatedToken.ts

@@ -0,0 +1,40 @@
+/**
+ * This code was AUTOGENERATED using the kinobi library.
+ * Please DO NOT EDIT THIS FILE, instead use visitors
+ * to add features, then rerun kinobi to update it.
+ *
+ * @see https://github.com/metaplex-foundation/kinobi
+ */
+
+import {
+  Address,
+  ProgramDerivedAddress,
+  getAddressEncoder,
+  getProgramDerivedAddress,
+} from '@solana/web3.js';
+
+export type AssociatedTokenSeeds = {
+  /** The wallet address of the associated token account. */
+  owner: Address;
+  /** The address of the token program to use. */
+  tokenProgram: Address;
+  /** The mint address of the associated token account. */
+  mint: Address;
+};
+
+export async function findAssociatedTokenPda(
+  seeds: AssociatedTokenSeeds,
+  config: { programAddress?: Address | undefined } = {}
+): Promise<ProgramDerivedAddress> {
+  const {
+    programAddress = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>,
+  } = config;
+  return await getProgramDerivedAddress({
+    programAddress,
+    seeds: [
+      getAddressEncoder().encode(seeds.owner),
+      getAddressEncoder().encode(seeds.tokenProgram),
+      getAddressEncoder().encode(seeds.mint),
+    ],
+  });
+}

+ 9 - 0
clients/js/src/generated/pdas/index.ts

@@ -0,0 +1,9 @@
+/**
+ * This code was AUTOGENERATED using the kinobi library.
+ * Please DO NOT EDIT THIS FILE, instead use visitors
+ * to add features, then rerun kinobi to update it.
+ *
+ * @see https://github.com/metaplex-foundation/kinobi
+ */
+
+export * from './associatedToken';

+ 202 - 6
program/idl.json

@@ -2250,7 +2250,38 @@
   "additionalPrograms": [
     {
       "kind": "programNode",
-      "pdas": [],
+      "pdas": [
+        {
+          "kind": "pdaNode",
+          "name": "associatedToken",
+          "seeds": [
+            {
+              "kind": "variablePdaSeedNode",
+              "name": "owner",
+              "docs": ["The wallet address of the associated token account."],
+              "type": {
+                "kind": "publicKeyTypeNode"
+              }
+            },
+            {
+              "kind": "variablePdaSeedNode",
+              "name": "tokenProgram",
+              "docs": ["The address of the token program to use."],
+              "type": {
+                "kind": "publicKeyTypeNode"
+              }
+            },
+            {
+              "kind": "variablePdaSeedNode",
+              "name": "mint",
+              "docs": ["The mint address of the associated token account."],
+              "type": {
+                "kind": "publicKeyTypeNode"
+              }
+            }
+          ]
+        }
+      ],
       "accounts": [],
       "instructions": [
         {
@@ -2271,7 +2302,40 @@
               "isWritable": true,
               "isSigner": false,
               "isOptional": false,
-              "docs": ["Associated token account address to be created."]
+              "docs": ["Associated token account address to be created."],
+              "defaultValue": {
+                "kind": "pdaValueNode",
+                "pda": {
+                  "kind": "pdaLinkNode",
+                  "name": "associatedToken"
+                },
+                "seeds": [
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "owner",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "owner"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "tokenProgram",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "tokenProgram"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "mint",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "mint"
+                    }
+                  }
+                ]
+              }
             },
             {
               "kind": "instructionAccountNode",
@@ -2340,7 +2404,40 @@
               "isWritable": true,
               "isSigner": false,
               "isOptional": false,
-              "docs": ["Associated token account address to be created."]
+              "docs": ["Associated token account address to be created."],
+              "defaultValue": {
+                "kind": "pdaValueNode",
+                "pda": {
+                  "kind": "pdaLinkNode",
+                  "name": "associatedToken"
+                },
+                "seeds": [
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "owner",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "owner"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "tokenProgram",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "tokenProgram"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "mint",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "mint"
+                    }
+                  }
+                ]
+              }
             },
             {
               "kind": "instructionAccountNode",
@@ -2403,7 +2500,40 @@
               "isOptional": false,
               "docs": [
                 "Nested associated token account, must be owned by `ownerAssociatedAccountAddress`."
-              ]
+              ],
+              "defaultValue": {
+                "kind": "pdaValueNode",
+                "pda": {
+                  "kind": "pdaLinkNode",
+                  "name": "associatedToken"
+                },
+                "seeds": [
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "owner",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "ownerAssociatedAccountAddress"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "tokenProgram",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "tokenProgram"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "mint",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "nestedTokenMintAddress"
+                    }
+                  }
+                ]
+              }
             },
             {
               "kind": "instructionAccountNode",
@@ -2419,7 +2549,40 @@
               "isWritable": true,
               "isSigner": false,
               "isOptional": false,
-              "docs": ["Wallet's associated token account."]
+              "docs": ["Wallet's associated token account."],
+              "defaultValue": {
+                "kind": "pdaValueNode",
+                "pda": {
+                  "kind": "pdaLinkNode",
+                  "name": "associatedToken"
+                },
+                "seeds": [
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "owner",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "walletAddress"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "tokenProgram",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "tokenProgram"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "mint",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "nestedTokenMintAddress"
+                    }
+                  }
+                ]
+              }
             },
             {
               "kind": "instructionAccountNode",
@@ -2429,7 +2592,40 @@
               "isOptional": false,
               "docs": [
                 "Owner associated token account address, must be owned by `walletAddress`."
-              ]
+              ],
+              "defaultValue": {
+                "kind": "pdaValueNode",
+                "pda": {
+                  "kind": "pdaLinkNode",
+                  "name": "associatedToken"
+                },
+                "seeds": [
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "owner",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "walletAddress"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "tokenProgram",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "tokenProgram"
+                    }
+                  },
+                  {
+                    "kind": "pdaSeedValueNode",
+                    "name": "mint",
+                    "value": {
+                      "kind": "accountValueNode",
+                      "name": "ownerTokenMintAddress"
+                    }
+                  }
+                ]
+              }
             },
             {
               "kind": "instructionAccountNode",