Skip to content

Commit

Permalink
removed multisigner for createNativeMint and formatted files
Browse files Browse the repository at this point in the history
  • Loading branch information
adpthegreat committed Nov 13, 2024
1 parent 68a78de commit 4906395
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
15 changes: 0 additions & 15 deletions clients/js/src/generated/instructions/createNativeMint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

import {
AccountRole,
combineCodec,
getStructDecoder,
getStructEncoder,
Expand Down Expand Up @@ -99,7 +98,6 @@ export type CreateNativeMintInput<
nativeMint: Address<TAccountNativeMint>;
/** System program for mint account funding */
systemProgram?: Address<TAccountSystemProgram>;
multiSigners?: Array<TransactionSigner>;
};

export function getCreateNativeMintInstruction<
Expand Down Expand Up @@ -134,31 +132,18 @@ export function getCreateNativeMintInstruction<
ResolvedAccount
>;

// Original args.
const args = { ...input };

// Resolve default values.
if (!accounts.systemProgram.value) {
accounts.systemProgram.value =
'11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
}

// 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.payer),
getAccountMeta(accounts.nativeMint),
getAccountMeta(accounts.systemProgram),
...remainingAccounts,
],
programAddress,
data: getCreateNativeMintInstructionDataEncoder().encode({}),
Expand Down
13 changes: 1 addition & 12 deletions program/idl.json
Original file line number Diff line number Diff line change
Expand Up @@ -5403,18 +5403,7 @@
}
}
],
"remainingAccounts": [
{
"kind": "instructionRemainingAccountsNode",
"isOptional": true,
"isSigner": true,
"docs": [],
"value": {
"kind": "argumentValueNode",
"name": "multiSigners"
}
}
],
"remainingAccounts": [],
"discriminators": [
{
"kind": "fieldDiscriminatorNode",
Expand Down

0 comments on commit 4906395

Please sign in to comment.