Browse Source

Improve Kinobi IDL

Loris Leiva 1 year ago
parent
commit
d8519213ab

+ 7 - 1
clients/js/src/generated/instructions/amountToUiAmount.ts

@@ -45,10 +45,14 @@ export type AmountToUiAmountInstruction<
 
 export type AmountToUiAmountInstructionData = {
   discriminator: number;
+  /** The amount of tokens to reformat. */
   amount: bigint;
 };
 
-export type AmountToUiAmountInstructionDataArgs = { amount: number | bigint };
+export type AmountToUiAmountInstructionDataArgs = {
+  /** The amount of tokens to reformat. */
+  amount: number | bigint;
+};
 
 export function getAmountToUiAmountInstructionDataEncoder(): Encoder<AmountToUiAmountInstructionDataArgs> {
   return transformEncoder(
@@ -78,6 +82,7 @@ export function getAmountToUiAmountInstructionDataCodec(): Codec<
 }
 
 export type AmountToUiAmountInput<TAccountMint extends string = string> = {
+  /** The mint to calculate for. */
   mint: Address<TAccountMint>;
   amount: AmountToUiAmountInstructionDataArgs['amount'];
 };
@@ -118,6 +123,7 @@ export type ParsedAmountToUiAmountInstruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The mint to calculate for. */
     mint: TAccountMetas[0];
   };
   data: AmountToUiAmountInstructionData;

+ 32 - 5
clients/js/src/generated/instructions/approveChecked.ts

@@ -7,6 +7,7 @@
  */
 
 import {
+  AccountRole,
   Address,
   Codec,
   Decoder,
@@ -53,8 +54,7 @@ export type ApproveCheckedInstruction<
         ? ReadonlyAccount<TAccountDelegate>
         : TAccountDelegate,
       TAccountOwner extends string
-        ? ReadonlySignerAccount<TAccountOwner> &
-            IAccountSignerMeta<TAccountOwner>
+        ? ReadonlyAccount<TAccountOwner>
         : TAccountOwner,
       ...TRemainingAccounts,
     ]
@@ -62,12 +62,16 @@ export type ApproveCheckedInstruction<
 
 export type ApproveCheckedInstructionData = {
   discriminator: number;
+  /** The amount of tokens the delegate is approved for. */
   amount: bigint;
+  /** Expected number of base 10 digits to the right of the decimal place. */
   decimals: number;
 };
 
 export type ApproveCheckedInstructionDataArgs = {
+  /** The amount of tokens the delegate is approved for. */
   amount: number | bigint;
+  /** Expected number of base 10 digits to the right of the decimal place. */
   decimals: number;
 };
 
@@ -106,12 +110,17 @@ export type ApproveCheckedInput<
   TAccountDelegate extends string = string,
   TAccountOwner extends string = string,
 > = {
+  /** The source account. */
   source: Address<TAccountSource>;
+  /** The token mint. */
   mint: Address<TAccountMint>;
+  /** The delegate. */
   delegate: Address<TAccountDelegate>;
-  owner: TransactionSigner<TAccountOwner>;
+  /** The source account owner or its multisignature account. */
+  owner: Address<TAccountOwner> | TransactionSigner<TAccountOwner>;
   amount: ApproveCheckedInstructionDataArgs['amount'];
   decimals: ApproveCheckedInstructionDataArgs['decimals'];
+  multiSigners?: Array<TransactionSigner>;
 };
 
 export function getApproveCheckedInstruction<
@@ -131,7 +140,9 @@ export function getApproveCheckedInstruction<
   TAccountSource,
   TAccountMint,
   TAccountDelegate,
-  TAccountOwner
+  (typeof input)['owner'] extends TransactionSigner<TAccountOwner>
+    ? ReadonlySignerAccount<TAccountOwner> & IAccountSignerMeta<TAccountOwner>
+    : TAccountOwner
 > {
   // Program address.
   const programAddress = TOKEN_PROGRAM_ADDRESS;
@@ -151,6 +162,15 @@ export function getApproveCheckedInstruction<
   // Original args.
   const args = { ...input };
 
+  // Remaining accounts.
+  const remainingAccounts: IAccountMeta[] = (args.multiSigners ?? []).map(
+    (signer) => ({
+      address: signer.address,
+      role: AccountRole.READONLY_SIGNER,
+      signer,
+    })
+  );
+
   const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
   const instruction = {
     accounts: [
@@ -158,6 +178,7 @@ export function getApproveCheckedInstruction<
       getAccountMeta(accounts.mint),
       getAccountMeta(accounts.delegate),
       getAccountMeta(accounts.owner),
+      ...remainingAccounts,
     ],
     programAddress,
     data: getApproveCheckedInstructionDataEncoder().encode(
@@ -168,7 +189,9 @@ export function getApproveCheckedInstruction<
     TAccountSource,
     TAccountMint,
     TAccountDelegate,
-    TAccountOwner
+    (typeof input)['owner'] extends TransactionSigner<TAccountOwner>
+      ? ReadonlySignerAccount<TAccountOwner> & IAccountSignerMeta<TAccountOwner>
+      : TAccountOwner
   >;
 
   return instruction;
@@ -180,9 +203,13 @@ export type ParsedApproveCheckedInstruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The source account. */
     source: TAccountMetas[0];
+    /** The token mint. */
     mint: TAccountMetas[1];
+    /** The delegate. */
     delegate: TAccountMetas[2];
+    /** The source account owner or its multisignature account. */
     owner: TAccountMetas[3];
   };
   data: ApproveCheckedInstructionData;

+ 33 - 5
clients/js/src/generated/instructions/burnChecked.ts

@@ -7,6 +7,7 @@
  */
 
 import {
+  AccountRole,
   Address,
   Codec,
   Decoder,
@@ -16,6 +17,7 @@ import {
   IInstruction,
   IInstructionWithAccounts,
   IInstructionWithData,
+  ReadonlyAccount,
   ReadonlySignerAccount,
   TransactionSigner,
   WritableAccount,
@@ -48,8 +50,7 @@ export type BurnCheckedInstruction<
         ? WritableAccount<TAccountMint>
         : TAccountMint,
       TAccountAuthority extends string
-        ? ReadonlySignerAccount<TAccountAuthority> &
-            IAccountSignerMeta<TAccountAuthority>
+        ? ReadonlyAccount<TAccountAuthority>
         : TAccountAuthority,
       ...TRemainingAccounts,
     ]
@@ -57,12 +58,16 @@ export type BurnCheckedInstruction<
 
 export type BurnCheckedInstructionData = {
   discriminator: number;
+  /** The amount of tokens to burn. */
   amount: bigint;
+  /** Expected number of base 10 digits to the right of the decimal place. */
   decimals: number;
 };
 
 export type BurnCheckedInstructionDataArgs = {
+  /** The amount of tokens to burn. */
   amount: number | bigint;
+  /** Expected number of base 10 digits to the right of the decimal place. */
   decimals: number;
 };
 
@@ -100,11 +105,15 @@ export type BurnCheckedInput<
   TAccountMint extends string = string,
   TAccountAuthority extends string = string,
 > = {
+  /** The account to burn from. */
   account: Address<TAccountAccount>;
+  /** The token mint. */
   mint: Address<TAccountMint>;
-  authority: TransactionSigner<TAccountAuthority>;
+  /** The account's owner/delegate or its multisignature account. */
+  authority: Address<TAccountAuthority> | TransactionSigner<TAccountAuthority>;
   amount: BurnCheckedInstructionDataArgs['amount'];
   decimals: BurnCheckedInstructionDataArgs['decimals'];
+  multiSigners?: Array<TransactionSigner>;
 };
 
 export function getBurnCheckedInstruction<
@@ -117,7 +126,10 @@ export function getBurnCheckedInstruction<
   typeof TOKEN_PROGRAM_ADDRESS,
   TAccountAccount,
   TAccountMint,
-  TAccountAuthority
+  (typeof input)['authority'] extends TransactionSigner<TAccountAuthority>
+    ? ReadonlySignerAccount<TAccountAuthority> &
+        IAccountSignerMeta<TAccountAuthority>
+    : TAccountAuthority
 > {
   // Program address.
   const programAddress = TOKEN_PROGRAM_ADDRESS;
@@ -136,12 +148,22 @@ export function getBurnCheckedInstruction<
   // Original args.
   const args = { ...input };
 
+  // Remaining accounts.
+  const remainingAccounts: IAccountMeta[] = (args.multiSigners ?? []).map(
+    (signer) => ({
+      address: signer.address,
+      role: AccountRole.READONLY_SIGNER,
+      signer,
+    })
+  );
+
   const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
   const instruction = {
     accounts: [
       getAccountMeta(accounts.account),
       getAccountMeta(accounts.mint),
       getAccountMeta(accounts.authority),
+      ...remainingAccounts,
     ],
     programAddress,
     data: getBurnCheckedInstructionDataEncoder().encode(
@@ -151,7 +173,10 @@ export function getBurnCheckedInstruction<
     typeof TOKEN_PROGRAM_ADDRESS,
     TAccountAccount,
     TAccountMint,
-    TAccountAuthority
+    (typeof input)['authority'] extends TransactionSigner<TAccountAuthority>
+      ? ReadonlySignerAccount<TAccountAuthority> &
+          IAccountSignerMeta<TAccountAuthority>
+      : TAccountAuthority
   >;
 
   return instruction;
@@ -163,8 +188,11 @@ export type ParsedBurnCheckedInstruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The account to burn from. */
     account: TAccountMetas[0];
+    /** The token mint. */
     mint: TAccountMetas[1];
+    /** The account's owner/delegate or its multisignature account. */
     authority: TAccountMetas[2];
   };
   data: BurnCheckedInstructionData;

+ 28 - 21
clients/js/src/generated/instructions/getTokenDataSize.ts → clients/js/src/generated/instructions/getAccountDataSize.ts

@@ -26,7 +26,7 @@ import {
 import { TOKEN_PROGRAM_ADDRESS } from '../programs';
 import { ResolvedAccount, getAccountMetaFactory } from '../shared';
 
-export type GetTokenDataSizeInstruction<
+export type GetAccountDataSizeInstruction<
   TProgram extends string = typeof TOKEN_PROGRAM_ADDRESS,
   TAccountMint extends string | IAccountMeta<string> = string,
   TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
@@ -41,38 +41,39 @@ export type GetTokenDataSizeInstruction<
     ]
   >;
 
-export type GetTokenDataSizeInstructionData = { discriminator: number };
+export type GetAccountDataSizeInstructionData = { discriminator: number };
 
-export type GetTokenDataSizeInstructionDataArgs = {};
+export type GetAccountDataSizeInstructionDataArgs = {};
 
-export function getGetTokenDataSizeInstructionDataEncoder(): Encoder<GetTokenDataSizeInstructionDataArgs> {
+export function getGetAccountDataSizeInstructionDataEncoder(): Encoder<GetAccountDataSizeInstructionDataArgs> {
   return transformEncoder(
     getStructEncoder([['discriminator', getU8Encoder()]]),
     (value) => ({ ...value, discriminator: 21 })
   );
 }
 
-export function getGetTokenDataSizeInstructionDataDecoder(): Decoder<GetTokenDataSizeInstructionData> {
+export function getGetAccountDataSizeInstructionDataDecoder(): Decoder<GetAccountDataSizeInstructionData> {
   return getStructDecoder([['discriminator', getU8Decoder()]]);
 }
 
-export function getGetTokenDataSizeInstructionDataCodec(): Codec<
-  GetTokenDataSizeInstructionDataArgs,
-  GetTokenDataSizeInstructionData
+export function getGetAccountDataSizeInstructionDataCodec(): Codec<
+  GetAccountDataSizeInstructionDataArgs,
+  GetAccountDataSizeInstructionData
 > {
   return combineCodec(
-    getGetTokenDataSizeInstructionDataEncoder(),
-    getGetTokenDataSizeInstructionDataDecoder()
+    getGetAccountDataSizeInstructionDataEncoder(),
+    getGetAccountDataSizeInstructionDataDecoder()
   );
 }
 
-export type GetTokenDataSizeInput<TAccountMint extends string = string> = {
+export type GetAccountDataSizeInput<TAccountMint extends string = string> = {
+  /** The mint to calculate for. */
   mint: Address<TAccountMint>;
 };
 
-export function getGetTokenDataSizeInstruction<TAccountMint extends string>(
-  input: GetTokenDataSizeInput<TAccountMint>
-): GetTokenDataSizeInstruction<typeof TOKEN_PROGRAM_ADDRESS, TAccountMint> {
+export function getGetAccountDataSizeInstruction<TAccountMint extends string>(
+  input: GetAccountDataSizeInput<TAccountMint>
+): GetAccountDataSizeInstruction<typeof TOKEN_PROGRAM_ADDRESS, TAccountMint> {
   // Program address.
   const programAddress = TOKEN_PROGRAM_ADDRESS;
 
@@ -89,31 +90,35 @@ export function getGetTokenDataSizeInstruction<TAccountMint extends string>(
   const instruction = {
     accounts: [getAccountMeta(accounts.mint)],
     programAddress,
-    data: getGetTokenDataSizeInstructionDataEncoder().encode({}),
-  } as GetTokenDataSizeInstruction<typeof TOKEN_PROGRAM_ADDRESS, TAccountMint>;
+    data: getGetAccountDataSizeInstructionDataEncoder().encode({}),
+  } as GetAccountDataSizeInstruction<
+    typeof TOKEN_PROGRAM_ADDRESS,
+    TAccountMint
+  >;
 
   return instruction;
 }
 
-export type ParsedGetTokenDataSizeInstruction<
+export type ParsedGetAccountDataSizeInstruction<
   TProgram extends string = typeof TOKEN_PROGRAM_ADDRESS,
   TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The mint to calculate for. */
     mint: TAccountMetas[0];
   };
-  data: GetTokenDataSizeInstructionData;
+  data: GetAccountDataSizeInstructionData;
 };
 
-export function parseGetTokenDataSizeInstruction<
+export function parseGetAccountDataSizeInstruction<
   TProgram extends string,
   TAccountMetas extends readonly IAccountMeta[],
 >(
   instruction: IInstruction<TProgram> &
     IInstructionWithAccounts<TAccountMetas> &
     IInstructionWithData<Uint8Array>
-): ParsedGetTokenDataSizeInstruction<TProgram, TAccountMetas> {
+): ParsedGetAccountDataSizeInstruction<TProgram, TAccountMetas> {
   if (instruction.accounts.length < 1) {
     // TODO: Coded error.
     throw new Error('Not enough accounts');
@@ -129,6 +134,8 @@ export function parseGetTokenDataSizeInstruction<
     accounts: {
       mint: getNextAccount(),
     },
-    data: getGetTokenDataSizeInstructionDataDecoder().decode(instruction.data),
+    data: getGetAccountDataSizeInstructionDataDecoder().decode(
+      instruction.data
+    ),
   };
 }

+ 2 - 2
clients/js/src/generated/instructions/index.ts

@@ -15,7 +15,7 @@ export * from './closeAccount';
 export * from './createAssociatedToken';
 export * from './createIdempotentAssociatedToken';
 export * from './freezeAccount';
-export * from './getTokenDataSize';
+export * from './getAccountDataSize';
 export * from './initializeAccount';
 export * from './initializeAccount2';
 export * from './initializeAccount3';
@@ -25,7 +25,7 @@ export * from './initializeMint2';
 export * from './initializeMultisig';
 export * from './initializeMultisig2';
 export * from './mintTo';
-export * from './mintTokensToChecked';
+export * from './mintToChecked';
 export * from './recoverNestedAssociatedToken';
 export * from './revoke';
 export * from './setAuthority';

+ 11 - 1
clients/js/src/generated/instructions/initializeAccount2.ts

@@ -56,10 +56,14 @@ export type InitializeAccount2Instruction<
 
 export type InitializeAccount2InstructionData = {
   discriminator: number;
+  /** The new account's owner/multisignature. */
   owner: Address;
 };
 
-export type InitializeAccount2InstructionDataArgs = { owner: Address };
+export type InitializeAccount2InstructionDataArgs = {
+  /** The new account's owner/multisignature. */
+  owner: Address;
+};
 
 export function getInitializeAccount2InstructionDataEncoder(): Encoder<InitializeAccount2InstructionDataArgs> {
   return transformEncoder(
@@ -93,8 +97,11 @@ export type InitializeAccount2Input<
   TAccountMint extends string = string,
   TAccountRent extends string = string,
 > = {
+  /** The account to initialize. */
   account: Address<TAccountAccount>;
+  /** The mint this account will be associated with. */
   mint: Address<TAccountMint>;
+  /** Rent sysvar. */
   rent?: Address<TAccountRent>;
   owner: InitializeAccount2InstructionDataArgs['owner'];
 };
@@ -161,8 +168,11 @@ export type ParsedInitializeAccount2Instruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The account to initialize. */
     account: TAccountMetas[0];
+    /** The mint this account will be associated with. */
     mint: TAccountMetas[1];
+    /** Rent sysvar. */
     rent: TAccountMetas[2];
   };
   data: InitializeAccount2InstructionData;

+ 9 - 1
clients/js/src/generated/instructions/initializeAccount3.ts

@@ -50,10 +50,14 @@ export type InitializeAccount3Instruction<
 
 export type InitializeAccount3InstructionData = {
   discriminator: number;
+  /** The new account's owner/multisignature. */
   owner: Address;
 };
 
-export type InitializeAccount3InstructionDataArgs = { owner: Address };
+export type InitializeAccount3InstructionDataArgs = {
+  /** The new account's owner/multisignature. */
+  owner: Address;
+};
 
 export function getInitializeAccount3InstructionDataEncoder(): Encoder<InitializeAccount3InstructionDataArgs> {
   return transformEncoder(
@@ -86,7 +90,9 @@ export type InitializeAccount3Input<
   TAccountAccount extends string = string,
   TAccountMint extends string = string,
 > = {
+  /** The account to initialize. */
   account: Address<TAccountAccount>;
+  /** The mint this account will be associated with. */
   mint: Address<TAccountMint>;
   owner: InitializeAccount3InstructionDataArgs['owner'];
 };
@@ -139,7 +145,9 @@ export type ParsedInitializeAccount3Instruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The account to initialize. */
     account: TAccountMetas[0];
+    /** The mint this account will be associated with. */
     mint: TAccountMetas[1];
   };
   data: InitializeAccount3InstructionData;

+ 2 - 0
clients/js/src/generated/instructions/initializeImmutableOwner.ts

@@ -69,6 +69,7 @@ export function getInitializeImmutableOwnerInstructionDataCodec(): Codec<
 export type InitializeImmutableOwnerInput<
   TAccountAccount extends string = string,
 > = {
+  /** The account to initialize. */
   account: Address<TAccountAccount>;
 };
 
@@ -111,6 +112,7 @@ export type ParsedInitializeImmutableOwnerInstruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The account to initialize. */
     account: TAccountMetas[0];
   };
   data: InitializeImmutableOwnerInstructionData;

+ 8 - 0
clients/js/src/generated/instructions/initializeMint2.ts

@@ -49,14 +49,20 @@ export type InitializeMint2Instruction<
 
 export type InitializeMint2InstructionData = {
   discriminator: number;
+  /** Number of base 10 digits to the right of the decimal place. */
   decimals: number;
+  /** The authority/multisignature to mint tokens. */
   mintAuthority: Address;
+  /** The optional freeze authority/multisignature of the mint. */
   freezeAuthority: Option<Address>;
 };
 
 export type InitializeMint2InstructionDataArgs = {
+  /** Number of base 10 digits to the right of the decimal place. */
   decimals: number;
+  /** The authority/multisignature to mint tokens. */
   mintAuthority: Address;
+  /** The optional freeze authority/multisignature of the mint. */
   freezeAuthority: OptionOrNullable<Address>;
 };
 
@@ -92,6 +98,7 @@ export function getInitializeMint2InstructionDataCodec(): Codec<
 }
 
 export type InitializeMint2Input<TAccountMint extends string = string> = {
+  /** The mint to initialize. */
   mint: Address<TAccountMint>;
   decimals: InitializeMint2InstructionDataArgs['decimals'];
   mintAuthority: InitializeMint2InstructionDataArgs['mintAuthority'];
@@ -134,6 +141,7 @@ export type ParsedInitializeMint2Instruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The mint to initialize. */
     mint: TAccountMetas[0];
   };
   data: InitializeMint2InstructionData;

+ 5 - 4
clients/js/src/generated/instructions/initializeMultisig.ts

@@ -96,7 +96,7 @@ export type InitializeMultisigInput<
   /** Rent sysvar. */
   rent?: Address<TAccountRent>;
   m: InitializeMultisigInstructionDataArgs['m'];
-  signers?: Array<Address>;
+  signers: Array<Address>;
 };
 
 export function getInitializeMultisigInstruction<
@@ -132,9 +132,10 @@ export function getInitializeMultisigInstruction<
   }
 
   // Remaining accounts.
-  const remainingAccounts: IAccountMeta[] = (args.signers ?? []).map(
-    (address) => ({ address, role: AccountRole.READONLY })
-  );
+  const remainingAccounts: IAccountMeta[] = args.signers.map((address) => ({
+    address,
+    role: AccountRole.READONLY,
+  }));
 
   const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
   const instruction = {

+ 25 - 28
clients/js/src/generated/instructions/initializeMultisig2.ts

@@ -7,6 +7,7 @@
  */
 
 import {
+  AccountRole,
   Address,
   Codec,
   Decoder,
@@ -15,7 +16,6 @@ import {
   IInstruction,
   IInstructionWithAccounts,
   IInstructionWithData,
-  ReadonlyAccount,
   WritableAccount,
   combineCodec,
   getStructDecoder,
@@ -30,7 +30,6 @@ import { ResolvedAccount, getAccountMetaFactory } from '../shared';
 export type InitializeMultisig2Instruction<
   TProgram extends string = typeof TOKEN_PROGRAM_ADDRESS,
   TAccountMultisig extends string | IAccountMeta<string> = string,
-  TAccountSigner extends string | IAccountMeta<string> = string,
   TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
 > = IInstruction<TProgram> &
   IInstructionWithData<Uint8Array> &
@@ -39,19 +38,20 @@ export type InitializeMultisig2Instruction<
       TAccountMultisig extends string
         ? WritableAccount<TAccountMultisig>
         : TAccountMultisig,
-      TAccountSigner extends string
-        ? ReadonlyAccount<TAccountSigner>
-        : TAccountSigner,
       ...TRemainingAccounts,
     ]
   >;
 
 export type InitializeMultisig2InstructionData = {
   discriminator: number;
+  /** The number of signers (M) required to validate this multisignature account. */
   m: number;
 };
 
-export type InitializeMultisig2InstructionDataArgs = { m: number };
+export type InitializeMultisig2InstructionDataArgs = {
+  /** The number of signers (M) required to validate this multisignature account. */
+  m: number;
+};
 
 export function getInitializeMultisig2InstructionDataEncoder(): Encoder<InitializeMultisig2InstructionDataArgs> {
   return transformEncoder(
@@ -80,24 +80,21 @@ export function getInitializeMultisig2InstructionDataCodec(): Codec<
   );
 }
 
-export type InitializeMultisig2Input<
-  TAccountMultisig extends string = string,
-  TAccountSigner extends string = string,
-> = {
-  multisig: Address<TAccountMultisig>;
-  signer: Address<TAccountSigner>;
-  m: InitializeMultisig2InstructionDataArgs['m'];
-};
+export type InitializeMultisig2Input<TAccountMultisig extends string = string> =
+  {
+    /** The multisignature account to initialize. */
+    multisig: Address<TAccountMultisig>;
+    m: InitializeMultisig2InstructionDataArgs['m'];
+    signers: Array<Address>;
+  };
 
 export function getInitializeMultisig2Instruction<
   TAccountMultisig extends string,
-  TAccountSigner extends string,
 >(
-  input: InitializeMultisig2Input<TAccountMultisig, TAccountSigner>
+  input: InitializeMultisig2Input<TAccountMultisig>
 ): InitializeMultisig2Instruction<
   typeof TOKEN_PROGRAM_ADDRESS,
-  TAccountMultisig,
-  TAccountSigner
+  TAccountMultisig
 > {
   // Program address.
   const programAddress = TOKEN_PROGRAM_ADDRESS;
@@ -105,7 +102,6 @@ export function getInitializeMultisig2Instruction<
   // Original accounts.
   const originalAccounts = {
     multisig: { value: input.multisig ?? null, isWritable: true },
-    signer: { value: input.signer ?? null, isWritable: false },
   };
   const accounts = originalAccounts as Record<
     keyof typeof originalAccounts,
@@ -115,20 +111,22 @@ export function getInitializeMultisig2Instruction<
   // Original args.
   const args = { ...input };
 
+  // Remaining accounts.
+  const remainingAccounts: IAccountMeta[] = args.signers.map((address) => ({
+    address,
+    role: AccountRole.READONLY,
+  }));
+
   const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
   const instruction = {
-    accounts: [
-      getAccountMeta(accounts.multisig),
-      getAccountMeta(accounts.signer),
-    ],
+    accounts: [getAccountMeta(accounts.multisig), ...remainingAccounts],
     programAddress,
     data: getInitializeMultisig2InstructionDataEncoder().encode(
       args as InitializeMultisig2InstructionDataArgs
     ),
   } as InitializeMultisig2Instruction<
     typeof TOKEN_PROGRAM_ADDRESS,
-    TAccountMultisig,
-    TAccountSigner
+    TAccountMultisig
   >;
 
   return instruction;
@@ -140,8 +138,8 @@ export type ParsedInitializeMultisig2Instruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The multisignature account to initialize. */
     multisig: TAccountMetas[0];
-    signer: TAccountMetas[1];
   };
   data: InitializeMultisig2InstructionData;
 };
@@ -154,7 +152,7 @@ export function parseInitializeMultisig2Instruction<
     IInstructionWithAccounts<TAccountMetas> &
     IInstructionWithData<Uint8Array>
 ): ParsedInitializeMultisig2Instruction<TProgram, TAccountMetas> {
-  if (instruction.accounts.length < 2) {
+  if (instruction.accounts.length < 1) {
     // TODO: Coded error.
     throw new Error('Not enough accounts');
   }
@@ -168,7 +166,6 @@ export function parseInitializeMultisig2Instruction<
     programAddress: instruction.programAddress,
     accounts: {
       multisig: getNextAccount(),
-      signer: getNextAccount(),
     },
     data: getInitializeMultisig2InstructionDataDecoder().decode(
       instruction.data

+ 59 - 35
clients/js/src/generated/instructions/mintTokensToChecked.ts → clients/js/src/generated/instructions/mintToChecked.ts

@@ -7,6 +7,7 @@
  */
 
 import {
+  AccountRole,
   Address,
   Codec,
   Decoder,
@@ -16,6 +17,7 @@ import {
   IInstruction,
   IInstructionWithAccounts,
   IInstructionWithData,
+  ReadonlyAccount,
   ReadonlySignerAccount,
   TransactionSigner,
   WritableAccount,
@@ -31,7 +33,7 @@ import {
 import { TOKEN_PROGRAM_ADDRESS } from '../programs';
 import { ResolvedAccount, getAccountMetaFactory } from '../shared';
 
-export type MintTokensToCheckedInstruction<
+export type MintToCheckedInstruction<
   TProgram extends string = typeof TOKEN_PROGRAM_ADDRESS,
   TAccountMint extends string | IAccountMeta<string> = string,
   TAccountToken extends string | IAccountMeta<string> = string,
@@ -48,25 +50,28 @@ export type MintTokensToCheckedInstruction<
         ? WritableAccount<TAccountToken>
         : TAccountToken,
       TAccountMintAuthority extends string
-        ? ReadonlySignerAccount<TAccountMintAuthority> &
-            IAccountSignerMeta<TAccountMintAuthority>
+        ? ReadonlyAccount<TAccountMintAuthority>
         : TAccountMintAuthority,
       ...TRemainingAccounts,
     ]
   >;
 
-export type MintTokensToCheckedInstructionData = {
+export type MintToCheckedInstructionData = {
   discriminator: number;
+  /** The amount of new tokens to mint. */
   amount: bigint;
+  /** Expected number of base 10 digits to the right of the decimal place. */
   decimals: number;
 };
 
-export type MintTokensToCheckedInstructionDataArgs = {
+export type MintToCheckedInstructionDataArgs = {
+  /** The amount of new tokens to mint. */
   amount: number | bigint;
+  /** Expected number of base 10 digits to the right of the decimal place. */
   decimals: number;
 };
 
-export function getMintTokensToCheckedInstructionDataEncoder(): Encoder<MintTokensToCheckedInstructionDataArgs> {
+export function getMintToCheckedInstructionDataEncoder(): Encoder<MintToCheckedInstructionDataArgs> {
   return transformEncoder(
     getStructEncoder([
       ['discriminator', getU8Encoder()],
@@ -77,7 +82,7 @@ export function getMintTokensToCheckedInstructionDataEncoder(): Encoder<MintToke
   );
 }
 
-export function getMintTokensToCheckedInstructionDataDecoder(): Decoder<MintTokensToCheckedInstructionData> {
+export function getMintToCheckedInstructionDataDecoder(): Decoder<MintToCheckedInstructionData> {
   return getStructDecoder([
     ['discriminator', getU8Decoder()],
     ['amount', getU64Decoder()],
@@ -85,43 +90,48 @@ export function getMintTokensToCheckedInstructionDataDecoder(): Decoder<MintToke
   ]);
 }
 
-export function getMintTokensToCheckedInstructionDataCodec(): Codec<
-  MintTokensToCheckedInstructionDataArgs,
-  MintTokensToCheckedInstructionData
+export function getMintToCheckedInstructionDataCodec(): Codec<
+  MintToCheckedInstructionDataArgs,
+  MintToCheckedInstructionData
 > {
   return combineCodec(
-    getMintTokensToCheckedInstructionDataEncoder(),
-    getMintTokensToCheckedInstructionDataDecoder()
+    getMintToCheckedInstructionDataEncoder(),
+    getMintToCheckedInstructionDataDecoder()
   );
 }
 
-export type MintTokensToCheckedInput<
+export type MintToCheckedInput<
   TAccountMint extends string = string,
   TAccountToken extends string = string,
   TAccountMintAuthority extends string = string,
 > = {
+  /** The mint. */
   mint: Address<TAccountMint>;
+  /** The account to mint tokens to. */
   token: Address<TAccountToken>;
-  mintAuthority: TransactionSigner<TAccountMintAuthority>;
-  amount: MintTokensToCheckedInstructionDataArgs['amount'];
-  decimals: MintTokensToCheckedInstructionDataArgs['decimals'];
+  /** The mint's minting authority or its multisignature account. */
+  mintAuthority:
+    | Address<TAccountMintAuthority>
+    | TransactionSigner<TAccountMintAuthority>;
+  amount: MintToCheckedInstructionDataArgs['amount'];
+  decimals: MintToCheckedInstructionDataArgs['decimals'];
+  multiSigners?: Array<TransactionSigner>;
 };
 
-export function getMintTokensToCheckedInstruction<
+export function getMintToCheckedInstruction<
   TAccountMint extends string,
   TAccountToken extends string,
   TAccountMintAuthority extends string,
 >(
-  input: MintTokensToCheckedInput<
-    TAccountMint,
-    TAccountToken,
-    TAccountMintAuthority
-  >
-): MintTokensToCheckedInstruction<
+  input: MintToCheckedInput<TAccountMint, TAccountToken, TAccountMintAuthority>
+): MintToCheckedInstruction<
   typeof TOKEN_PROGRAM_ADDRESS,
   TAccountMint,
   TAccountToken,
-  TAccountMintAuthority
+  (typeof input)['mintAuthority'] extends TransactionSigner<TAccountMintAuthority>
+    ? ReadonlySignerAccount<TAccountMintAuthority> &
+        IAccountSignerMeta<TAccountMintAuthority>
+    : TAccountMintAuthority
 > {
   // Program address.
   const programAddress = TOKEN_PROGRAM_ADDRESS;
@@ -140,48 +150,64 @@ export function getMintTokensToCheckedInstruction<
   // Original args.
   const args = { ...input };
 
+  // Remaining accounts.
+  const remainingAccounts: IAccountMeta[] = (args.multiSigners ?? []).map(
+    (signer) => ({
+      address: signer.address,
+      role: AccountRole.READONLY_SIGNER,
+      signer,
+    })
+  );
+
   const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
   const instruction = {
     accounts: [
       getAccountMeta(accounts.mint),
       getAccountMeta(accounts.token),
       getAccountMeta(accounts.mintAuthority),
+      ...remainingAccounts,
     ],
     programAddress,
-    data: getMintTokensToCheckedInstructionDataEncoder().encode(
-      args as MintTokensToCheckedInstructionDataArgs
+    data: getMintToCheckedInstructionDataEncoder().encode(
+      args as MintToCheckedInstructionDataArgs
     ),
-  } as MintTokensToCheckedInstruction<
+  } as MintToCheckedInstruction<
     typeof TOKEN_PROGRAM_ADDRESS,
     TAccountMint,
     TAccountToken,
-    TAccountMintAuthority
+    (typeof input)['mintAuthority'] extends TransactionSigner<TAccountMintAuthority>
+      ? ReadonlySignerAccount<TAccountMintAuthority> &
+          IAccountSignerMeta<TAccountMintAuthority>
+      : TAccountMintAuthority
   >;
 
   return instruction;
 }
 
-export type ParsedMintTokensToCheckedInstruction<
+export type ParsedMintToCheckedInstruction<
   TProgram extends string = typeof TOKEN_PROGRAM_ADDRESS,
   TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The mint. */
     mint: TAccountMetas[0];
+    /** The account to mint tokens to. */
     token: TAccountMetas[1];
+    /** The mint's minting authority or its multisignature account. */
     mintAuthority: TAccountMetas[2];
   };
-  data: MintTokensToCheckedInstructionData;
+  data: MintToCheckedInstructionData;
 };
 
-export function parseMintTokensToCheckedInstruction<
+export function parseMintToCheckedInstruction<
   TProgram extends string,
   TAccountMetas extends readonly IAccountMeta[],
 >(
   instruction: IInstruction<TProgram> &
     IInstructionWithAccounts<TAccountMetas> &
     IInstructionWithData<Uint8Array>
-): ParsedMintTokensToCheckedInstruction<TProgram, TAccountMetas> {
+): ParsedMintToCheckedInstruction<TProgram, TAccountMetas> {
   if (instruction.accounts.length < 3) {
     // TODO: Coded error.
     throw new Error('Not enough accounts');
@@ -199,8 +225,6 @@ export function parseMintTokensToCheckedInstruction<
       token: getNextAccount(),
       mintAuthority: getNextAccount(),
     },
-    data: getMintTokensToCheckedInstructionDataDecoder().decode(
-      instruction.data
-    ),
+    data: getMintToCheckedInstructionDataDecoder().decode(instruction.data),
   };
 }

+ 2 - 0
clients/js/src/generated/instructions/syncNative.ts

@@ -67,6 +67,7 @@ export function getSyncNativeInstructionDataCodec(): Codec<
 }
 
 export type SyncNativeInput<TAccountAccount extends string = string> = {
+  /** The native token account to sync with its underlying lamports. */
   account: Address<TAccountAccount>;
 };
 
@@ -101,6 +102,7 @@ export type ParsedSyncNativeInstruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The native token account to sync with its underlying lamports. */
     account: TAccountMetas[0];
   };
   data: SyncNativeInstructionData;

+ 12 - 6
clients/js/src/generated/instructions/uiAmountToAmount.ts

@@ -19,10 +19,10 @@ import {
   combineCodec,
   getStructDecoder,
   getStructEncoder,
-  getU64Decoder,
-  getU64Encoder,
   getU8Decoder,
   getU8Encoder,
+  getUtf8Decoder,
+  getUtf8Encoder,
   transformEncoder,
 } from '@solana/web3.js';
 import { TOKEN_PROGRAM_ADDRESS } from '../programs';
@@ -45,16 +45,20 @@ export type UiAmountToAmountInstruction<
 
 export type UiAmountToAmountInstructionData = {
   discriminator: number;
-  uiAmount: bigint;
+  /** The ui_amount of tokens to reformat. */
+  uiAmount: string;
 };
 
-export type UiAmountToAmountInstructionDataArgs = { uiAmount: number | bigint };
+export type UiAmountToAmountInstructionDataArgs = {
+  /** The ui_amount of tokens to reformat. */
+  uiAmount: string;
+};
 
 export function getUiAmountToAmountInstructionDataEncoder(): Encoder<UiAmountToAmountInstructionDataArgs> {
   return transformEncoder(
     getStructEncoder([
       ['discriminator', getU8Encoder()],
-      ['uiAmount', getU64Encoder()],
+      ['uiAmount', getUtf8Encoder()],
     ]),
     (value) => ({ ...value, discriminator: 24 })
   );
@@ -63,7 +67,7 @@ export function getUiAmountToAmountInstructionDataEncoder(): Encoder<UiAmountToA
 export function getUiAmountToAmountInstructionDataDecoder(): Decoder<UiAmountToAmountInstructionData> {
   return getStructDecoder([
     ['discriminator', getU8Decoder()],
-    ['uiAmount', getU64Decoder()],
+    ['uiAmount', getUtf8Decoder()],
   ]);
 }
 
@@ -78,6 +82,7 @@ export function getUiAmountToAmountInstructionDataCodec(): Codec<
 }
 
 export type UiAmountToAmountInput<TAccountMint extends string = string> = {
+  /** The mint to calculate for. */
   mint: Address<TAccountMint>;
   uiAmount: UiAmountToAmountInstructionDataArgs['uiAmount'];
 };
@@ -118,6 +123,7 @@ export type ParsedUiAmountToAmountInstruction<
 > = {
   programAddress: Address<TProgram>;
   accounts: {
+    /** The mint to calculate for. */
     mint: TAccountMetas[0];
   };
   data: UiAmountToAmountInstructionData;

+ 10 - 10
clients/js/src/generated/programs/token.ts

@@ -15,7 +15,7 @@ import {
   ParsedBurnInstruction,
   ParsedCloseAccountInstruction,
   ParsedFreezeAccountInstruction,
-  ParsedGetTokenDataSizeInstruction,
+  ParsedGetAccountDataSizeInstruction,
   ParsedInitializeAccount2Instruction,
   ParsedInitializeAccount3Instruction,
   ParsedInitializeAccountInstruction,
@@ -24,8 +24,8 @@ import {
   ParsedInitializeMintInstruction,
   ParsedInitializeMultisig2Instruction,
   ParsedInitializeMultisigInstruction,
+  ParsedMintToCheckedInstruction,
   ParsedMintToInstruction,
-  ParsedMintTokensToCheckedInstruction,
   ParsedRevokeInstruction,
   ParsedSetAuthorityInstruction,
   ParsedSyncNativeInstruction,
@@ -59,14 +59,14 @@ export enum TokenInstruction {
   ThawAccount,
   TransferChecked,
   ApproveChecked,
-  MintTokensToChecked,
+  MintToChecked,
   BurnChecked,
   InitializeAccount2,
   SyncNative,
   InitializeAccount3,
   InitializeMultisig2,
   InitializeMint2,
-  GetTokenDataSize,
+  GetAccountDataSize,
   InitializeImmutableOwner,
   AmountToUiAmount,
   UiAmountToAmount,
@@ -120,7 +120,7 @@ export function identifyTokenInstruction(
     return TokenInstruction.ApproveChecked;
   }
   if (containsBytes(data, getU8Encoder().encode(14), 0)) {
-    return TokenInstruction.MintTokensToChecked;
+    return TokenInstruction.MintToChecked;
   }
   if (containsBytes(data, getU8Encoder().encode(15), 0)) {
     return TokenInstruction.BurnChecked;
@@ -141,7 +141,7 @@ export function identifyTokenInstruction(
     return TokenInstruction.InitializeMint2;
   }
   if (containsBytes(data, getU8Encoder().encode(21), 0)) {
-    return TokenInstruction.GetTokenDataSize;
+    return TokenInstruction.GetAccountDataSize;
   }
   if (containsBytes(data, getU8Encoder().encode(22), 0)) {
     return TokenInstruction.InitializeImmutableOwner;
@@ -203,8 +203,8 @@ export type ParsedTokenInstruction<
       instructionType: TokenInstruction.ApproveChecked;
     } & ParsedApproveCheckedInstruction<TProgram>)
   | ({
-      instructionType: TokenInstruction.MintTokensToChecked;
-    } & ParsedMintTokensToCheckedInstruction<TProgram>)
+      instructionType: TokenInstruction.MintToChecked;
+    } & ParsedMintToCheckedInstruction<TProgram>)
   | ({
       instructionType: TokenInstruction.BurnChecked;
     } & ParsedBurnCheckedInstruction<TProgram>)
@@ -224,8 +224,8 @@ export type ParsedTokenInstruction<
       instructionType: TokenInstruction.InitializeMint2;
     } & ParsedInitializeMint2Instruction<TProgram>)
   | ({
-      instructionType: TokenInstruction.GetTokenDataSize;
-    } & ParsedGetTokenDataSizeInstruction<TProgram>)
+      instructionType: TokenInstruction.GetAccountDataSize;
+    } & ParsedGetAccountDataSizeInstruction<TProgram>)
   | ({
       instructionType: TokenInstruction.InitializeImmutableOwner;
     } & ParsedInitializeImmutableOwnerInstruction<TProgram>)

+ 185 - 68
program/idl.json

@@ -383,7 +383,7 @@
         ],
         "name": "initializeAccount",
         "docs": [
-          "Initializes a new account to hold tokens.  If this account is associated",
+          "Initializes a new account to hold tokens. If this account is associated",
           "with the native mint then the token balance of the initialized account",
           "will be equal to the amount of SOL in the account. If this account is",
           "associated with another mint, that mint must be initialized before this",
@@ -459,8 +459,7 @@
             "value": {
               "kind": "argumentValueNode",
               "name": "signers"
-            },
-            "isOptional": true
+            }
           }
         ],
         "name": "initializeMultisig",
@@ -469,7 +468,7 @@
           "",
           "Multisignature accounts can used in place of any single owner/delegate",
           "accounts in any token instruction that require an owner/delegate to be",
-          "present.  The variant field represents the number of signers (M)",
+          "present. The variant field represents the number of signers (M)",
           "required to validate this multisignature account.",
           "",
           "The `InitializeMultisig` instruction requires no signers and MUST be",
@@ -1243,7 +1242,7 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The source account."]
           },
           {
             "kind": "instructionAccountNode",
@@ -1251,7 +1250,7 @@
             "isWritable": false,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The token mint."]
           },
           {
             "kind": "instructionAccountNode",
@@ -1259,15 +1258,15 @@
             "isWritable": false,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The delegate."]
           },
           {
             "kind": "instructionAccountNode",
             "name": "owner",
             "isWritable": false,
-            "isSigner": true,
+            "isSigner": "either",
             "isOptional": false,
-            "docs": []
+            "docs": ["The source account owner or its multisignature account."]
           }
         ],
         "arguments": [
@@ -1291,7 +1290,7 @@
               "format": "u64",
               "endian": "le"
             },
-            "docs": []
+            "docs": ["The amount of tokens the delegate is approved for."]
           },
           {
             "kind": "instructionArgumentNode",
@@ -1301,7 +1300,9 @@
               "format": "u8",
               "endian": "le"
             },
-            "docs": []
+            "docs": [
+              "Expected number of base 10 digits to the right of the decimal place."
+            ]
           }
         ],
         "discriminators": [
@@ -1311,8 +1312,26 @@
             "offset": 0
           }
         ],
+        "remainingAccounts": [
+          {
+            "kind": "instructionRemainingAccountsNode",
+            "value": {
+              "kind": "argumentValueNode",
+              "name": "multiSigners"
+            },
+            "isOptional": true,
+            "isSigner": true
+          }
+        ],
         "name": "approveChecked",
-        "docs": [],
+        "docs": [
+          "Approves a delegate. A delegate is given the authority over tokens on",
+          "behalf of the source account's owner.",
+          "",
+          "This instruction differs from Approve in that the token mint and",
+          "decimals value is checked by the caller. This may be useful when",
+          "creating transactions offline or within a hardware wallet."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1324,7 +1343,7 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The mint."]
           },
           {
             "kind": "instructionAccountNode",
@@ -1332,15 +1351,17 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The account to mint tokens to."]
           },
           {
             "kind": "instructionAccountNode",
             "name": "mintAuthority",
             "isWritable": false,
-            "isSigner": true,
+            "isSigner": "either",
             "isOptional": false,
-            "docs": []
+            "docs": [
+              "The mint's minting authority or its multisignature account."
+            ]
           }
         ],
         "arguments": [
@@ -1364,7 +1385,7 @@
               "format": "u64",
               "endian": "le"
             },
-            "docs": []
+            "docs": ["The amount of new tokens to mint."]
           },
           {
             "kind": "instructionArgumentNode",
@@ -1374,7 +1395,9 @@
               "format": "u8",
               "endian": "le"
             },
-            "docs": []
+            "docs": [
+              "Expected number of base 10 digits to the right of the decimal place."
+            ]
           }
         ],
         "discriminators": [
@@ -1384,8 +1407,25 @@
             "offset": 0
           }
         ],
-        "name": "mintTokensToChecked",
-        "docs": [],
+        "remainingAccounts": [
+          {
+            "kind": "instructionRemainingAccountsNode",
+            "value": {
+              "kind": "argumentValueNode",
+              "name": "multiSigners"
+            },
+            "isOptional": true,
+            "isSigner": true
+          }
+        ],
+        "name": "mintToChecked",
+        "docs": [
+          "Mints new tokens to an account. The native mint does not support minting.",
+          "",
+          "This instruction differs from MintTo in that the decimals value is",
+          "checked by the caller. This may be useful when creating transactions",
+          "offline or within a hardware wallet."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1397,7 +1437,7 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The account to burn from."]
           },
           {
             "kind": "instructionAccountNode",
@@ -1405,15 +1445,17 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The token mint."]
           },
           {
             "kind": "instructionAccountNode",
             "name": "authority",
             "isWritable": false,
-            "isSigner": true,
+            "isSigner": "either",
             "isOptional": false,
-            "docs": [],
+            "docs": [
+              "The account's owner/delegate or its multisignature account."
+            ],
             "defaultValue": { "kind": "identityValueNode" }
           }
         ],
@@ -1438,7 +1480,7 @@
               "format": "u64",
               "endian": "le"
             },
-            "docs": []
+            "docs": ["The amount of tokens to burn."]
           },
           {
             "kind": "instructionArgumentNode",
@@ -1448,7 +1490,9 @@
               "format": "u8",
               "endian": "le"
             },
-            "docs": []
+            "docs": [
+              "Expected number of base 10 digits to the right of the decimal place."
+            ]
           }
         ],
         "discriminators": [
@@ -1458,8 +1502,26 @@
             "offset": 0
           }
         ],
+        "remainingAccounts": [
+          {
+            "kind": "instructionRemainingAccountsNode",
+            "value": {
+              "kind": "argumentValueNode",
+              "name": "multiSigners"
+            },
+            "isOptional": true,
+            "isSigner": true
+          }
+        ],
         "name": "burnChecked",
-        "docs": [],
+        "docs": [
+          "Burns tokens by removing them from an account. `BurnChecked` does not",
+          "support accounts associated with the native mint, use `CloseAccount` instead.",
+          "",
+          "This instruction differs from Burn in that the decimals value is checked",
+          "by the caller. This may be useful when creating transactions offline or",
+          "within a hardware wallet."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1471,7 +1533,7 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The account to initialize."]
           },
           {
             "kind": "instructionAccountNode",
@@ -1479,7 +1541,7 @@
             "isWritable": false,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The mint this account will be associated with."]
           },
           {
             "kind": "instructionAccountNode",
@@ -1487,7 +1549,7 @@
             "isWritable": false,
             "isSigner": false,
             "isOptional": false,
-            "docs": [],
+            "docs": ["Rent sysvar."],
             "defaultValue": {
               "kind": "publicKeyValueNode",
               "publicKey": "SysvarRent111111111111111111111111111111111"
@@ -1511,7 +1573,7 @@
             "kind": "instructionArgumentNode",
             "name": "owner",
             "type": { "kind": "publicKeyTypeNode" },
-            "docs": []
+            "docs": ["The new account's owner/multisignature."]
           }
         ],
         "discriminators": [
@@ -1522,7 +1584,12 @@
           }
         ],
         "name": "initializeAccount2",
-        "docs": [],
+        "docs": [
+          "Like InitializeAccount, but the owner pubkey is passed via instruction",
+          "data rather than the accounts list. This variant may be preferable",
+          "when using Cross Program Invocation from an instruction that does",
+          "not need the owner's `AccountInfo` otherwise."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1534,7 +1601,9 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": [
+              "The native token account to sync with its underlying lamports."
+            ]
           }
         ],
         "arguments": [
@@ -1559,7 +1628,13 @@
           }
         ],
         "name": "syncNative",
-        "docs": [],
+        "docs": [
+          "Given a wrapped / native token account (a token account containing SOL)",
+          "updates its amount field based on the account's underlying `lamports`.",
+          "This is useful if a non-wrapped SOL account uses",
+          "`system_instruction::transfer` to move lamports to a wrapped token",
+          "account, and needs to have its token `amount` field updated."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1571,7 +1646,7 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The account to initialize."]
           },
           {
             "kind": "instructionAccountNode",
@@ -1579,7 +1654,7 @@
             "isWritable": false,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The mint this account will be associated with."]
           }
         ],
         "arguments": [
@@ -1599,7 +1674,7 @@
             "kind": "instructionArgumentNode",
             "name": "owner",
             "type": { "kind": "publicKeyTypeNode" },
-            "docs": []
+            "docs": ["The new account's owner/multisignature."]
           }
         ],
         "discriminators": [
@@ -1610,7 +1685,9 @@
           }
         ],
         "name": "initializeAccount3",
-        "docs": [],
+        "docs": [
+          "Like InitializeAccount2, but does not require the Rent sysvar to be provided."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1622,15 +1699,7 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
-          },
-          {
-            "kind": "instructionAccountNode",
-            "name": "signer",
-            "isWritable": false,
-            "isSigner": false,
-            "isOptional": false,
-            "docs": []
+            "docs": ["The multisignature account to initialize."]
           }
         ],
         "arguments": [
@@ -1654,7 +1723,9 @@
               "format": "u8",
               "endian": "le"
             },
-            "docs": []
+            "docs": [
+              "The number of signers (M) required to validate this multisignature account."
+            ]
           }
         ],
         "discriminators": [
@@ -1664,8 +1735,19 @@
             "offset": 0
           }
         ],
+        "remainingAccounts": [
+          {
+            "kind": "instructionRemainingAccountsNode",
+            "value": {
+              "kind": "argumentValueNode",
+              "name": "signers"
+            }
+          }
+        ],
         "name": "initializeMultisig2",
-        "docs": [],
+        "docs": [
+          "Like InitializeMultisig, but does not require the Rent sysvar to be provided."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1677,7 +1759,7 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The mint to initialize."]
           }
         ],
         "arguments": [
@@ -1701,13 +1783,15 @@
               "format": "u8",
               "endian": "le"
             },
-            "docs": []
+            "docs": [
+              "Number of base 10 digits to the right of the decimal place."
+            ]
           },
           {
             "kind": "instructionArgumentNode",
             "name": "mintAuthority",
             "type": { "kind": "publicKeyTypeNode" },
-            "docs": []
+            "docs": ["The authority/multisignature to mint tokens."]
           },
           {
             "kind": "instructionArgumentNode",
@@ -1722,7 +1806,9 @@
               },
               "fixed": false
             },
-            "docs": []
+            "docs": [
+              "The optional freeze authority/multisignature of the mint."
+            ]
           }
         ],
         "discriminators": [
@@ -1733,7 +1819,9 @@
           }
         ],
         "name": "initializeMint2",
-        "docs": [],
+        "docs": [
+          "Like [`InitializeMint`], but does not require the Rent sysvar to be provided."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1745,7 +1833,7 @@
             "isWritable": false,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The mint to calculate for."]
           }
         ],
         "arguments": [
@@ -1769,8 +1857,14 @@
             "offset": 0
           }
         ],
-        "name": "getTokenDataSize",
-        "docs": [],
+        "name": "getAccountDataSize",
+        "docs": [
+          "Gets the required size of an account for the given mint as a",
+          "little-endian `u64`.",
+          "",
+          "Return data can be fetched using `sol_get_return_data` and deserializing",
+          "the return data as a little-endian `u64`."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1782,7 +1876,7 @@
             "isWritable": true,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The account to initialize."]
           }
         ],
         "arguments": [
@@ -1807,7 +1901,15 @@
           }
         ],
         "name": "initializeImmutableOwner",
-        "docs": [],
+        "docs": [
+          "Initialize the Immutable Owner extension for the given token account",
+          "",
+          "Fails if the account has already been initialized, so must be called",
+          "before `InitializeAccount`.",
+          "",
+          "No-ops in this version of the program, but is included for compatibility",
+          "with the Associated Token Account program."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1819,7 +1921,7 @@
             "isWritable": false,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The mint to calculate for."]
           }
         ],
         "arguments": [
@@ -1843,7 +1945,7 @@
               "format": "u64",
               "endian": "le"
             },
-            "docs": []
+            "docs": ["The amount of tokens to reformat."]
           }
         ],
         "discriminators": [
@@ -1854,7 +1956,16 @@
           }
         ],
         "name": "amountToUiAmount",
-        "docs": [],
+        "docs": [
+          "Convert an Amount of tokens to a UiAmount `string`, using the given",
+          "mint. In this version of the program, the mint can only specify the",
+          "number of decimals.",
+          "",
+          "Fails on an invalid mint.",
+          "",
+          "Return data can be fetched using `sol_get_return_data` and deserialized",
+          "with `String::from_utf8`."
+        ],
         "optionalAccountStrategy": "programId"
       },
       {
@@ -1866,7 +1977,7 @@
             "isWritable": false,
             "isSigner": false,
             "isOptional": false,
-            "docs": []
+            "docs": ["The mint to calculate for."]
           }
         ],
         "arguments": [
@@ -1886,11 +1997,10 @@
             "kind": "instructionArgumentNode",
             "name": "uiAmount",
             "type": {
-              "kind": "numberTypeNode",
-              "format": "u64",
-              "endian": "le"
+              "kind": "stringTypeNode",
+              "encoding": "utf8"
             },
-            "docs": []
+            "docs": ["The ui_amount of tokens to reformat."]
           }
         ],
         "discriminators": [
@@ -1901,7 +2011,14 @@
           }
         ],
         "name": "uiAmountToAmount",
-        "docs": [],
+        "docs": [
+          "Convert a UiAmount of tokens to a little-endian `u64` raw Amount, using",
+          "the given mint. In this version of the program, the mint can only",
+          "specify the number of decimals.",
+          "",
+          "Return data can be fetched using `sol_get_return_data` and deserializing",
+          "the return data as a little-endian `u64`."
+        ],
         "optionalAccountStrategy": "programId"
       }
     ],