@solana-program/system 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.js +99 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +93 -2
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/generated/instructions/createAccountAllowPrefund.d.ts +53 -0
- package/dist/types/generated/instructions/createAccountAllowPrefund.d.ts.map +1 -0
- package/dist/types/generated/instructions/index.d.ts +1 -0
- package/dist/types/generated/instructions/index.d.ts.map +1 -1
- package/dist/types/generated/programs/system.d.ts +7 -3
- package/dist/types/generated/programs/system.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/instructions/createAccountAllowPrefund.ts +212 -0
- package/src/generated/instructions/index.ts +1 -0
- package/src/generated/programs/system.ts +24 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyUint8Array, type TransactionSigner, type WritableSignerAccount } from '@solana/kit';
|
|
9
|
+
import { type InstructionWithByteDelta } from '@solana/kit/program-client-core';
|
|
10
|
+
import { SYSTEM_PROGRAM_ADDRESS } from '../programs';
|
|
11
|
+
export declare const CREATE_ACCOUNT_ALLOW_PREFUND_DISCRIMINATOR = 13;
|
|
12
|
+
export declare function getCreateAccountAllowPrefundDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
+
export type CreateAccountAllowPrefundInstruction<TProgram extends string = typeof SYSTEM_PROGRAM_ADDRESS, TAccountNewAccount extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> | undefined = undefined, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
14
|
+
TAccountNewAccount extends string ? WritableSignerAccount<TAccountNewAccount> & AccountSignerMeta<TAccountNewAccount> : TAccountNewAccount,
|
|
15
|
+
...(TAccountPayer extends undefined ? [] : [
|
|
16
|
+
TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer
|
|
17
|
+
]),
|
|
18
|
+
...TRemainingAccounts
|
|
19
|
+
]>;
|
|
20
|
+
export type CreateAccountAllowPrefundInstructionData = {
|
|
21
|
+
discriminator: number;
|
|
22
|
+
lamports: bigint;
|
|
23
|
+
space: bigint;
|
|
24
|
+
programAddress: Address;
|
|
25
|
+
};
|
|
26
|
+
export type CreateAccountAllowPrefundInstructionDataArgs = {
|
|
27
|
+
lamports?: number | bigint;
|
|
28
|
+
space: number | bigint;
|
|
29
|
+
programAddress: Address;
|
|
30
|
+
};
|
|
31
|
+
export declare function getCreateAccountAllowPrefundInstructionDataEncoder(): FixedSizeEncoder<CreateAccountAllowPrefundInstructionDataArgs>;
|
|
32
|
+
export declare function getCreateAccountAllowPrefundInstructionDataDecoder(): FixedSizeDecoder<CreateAccountAllowPrefundInstructionData>;
|
|
33
|
+
export declare function getCreateAccountAllowPrefundInstructionDataCodec(): FixedSizeCodec<CreateAccountAllowPrefundInstructionDataArgs, CreateAccountAllowPrefundInstructionData>;
|
|
34
|
+
export type CreateAccountAllowPrefundInput<TAccountNewAccount extends string = string, TAccountPayer extends string = string> = {
|
|
35
|
+
newAccount: TransactionSigner<TAccountNewAccount>;
|
|
36
|
+
payer?: TransactionSigner<TAccountPayer>;
|
|
37
|
+
lamports?: CreateAccountAllowPrefundInstructionDataArgs['lamports'];
|
|
38
|
+
space: CreateAccountAllowPrefundInstructionDataArgs['space'];
|
|
39
|
+
programAddress: CreateAccountAllowPrefundInstructionDataArgs['programAddress'];
|
|
40
|
+
};
|
|
41
|
+
export declare function getCreateAccountAllowPrefundInstruction<TAccountNewAccount extends string, TAccountPayer extends string, TProgramAddress extends Address = typeof SYSTEM_PROGRAM_ADDRESS>(input: CreateAccountAllowPrefundInput<TAccountNewAccount, TAccountPayer>, config?: {
|
|
42
|
+
programAddress?: TProgramAddress;
|
|
43
|
+
}): CreateAccountAllowPrefundInstruction<TProgramAddress, TAccountNewAccount, TAccountPayer> & InstructionWithByteDelta;
|
|
44
|
+
export type ParsedCreateAccountAllowPrefundInstruction<TProgram extends string = typeof SYSTEM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
45
|
+
programAddress: Address<TProgram>;
|
|
46
|
+
accounts: {
|
|
47
|
+
newAccount: TAccountMetas[0];
|
|
48
|
+
payer?: TAccountMetas[1] | undefined;
|
|
49
|
+
};
|
|
50
|
+
data: CreateAccountAllowPrefundInstructionData;
|
|
51
|
+
};
|
|
52
|
+
export declare function parseCreateAccountAllowPrefundInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCreateAccountAllowPrefundInstruction<TProgram, TAccountMetas>;
|
|
53
|
+
//# sourceMappingURL=createAccountAllowPrefund.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAccountAllowPrefund.d.ts","sourceRoot":"","sources":["../../../../src/generated/instructions/createAccountAllowPrefund.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAcH,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,kB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AAC;QAC7B,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;KACxC,CAAC;IACF,IAAI,EAAE,wCAAwC,CAAC;CAClD,CAAC;AAEF,wBAAgB,yCAAyC,CACrD,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,WAAW,EAAE,EAE5C,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,GAC9B,uBAAuB,CAAC,aAAa,CAAC,GACtC,mBAAmB,CAAC,kBAAkB,CAAC,GAC5C,0CAA0C,CAAC,QAAQ,EAAE,aAAa,CAAC,CAwBrE"}
|
|
@@ -12,6 +12,7 @@ export * from './assign';
|
|
|
12
12
|
export * from './assignWithSeed';
|
|
13
13
|
export * from './authorizeNonceAccount';
|
|
14
14
|
export * from './createAccount';
|
|
15
|
+
export * from './createAccountAllowPrefund';
|
|
15
16
|
export * from './createAccountWithSeed';
|
|
16
17
|
export * from './initializeNonceAccount';
|
|
17
18
|
export * from './transferSol';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { type Address, type ClientWithPayer, type ClientWithRpc, type ClientWithTransactionPlanning, type ClientWithTransactionSending, type GetAccountInfoApi, type GetMultipleAccountsApi, type Instruction, type InstructionWithData, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
9
|
import { type SelfFetchFunctions, type SelfPlanAndSendFunctions } from '@solana/kit/program-client-core';
|
|
10
10
|
import { getNonceCodec, type Nonce, type NonceArgs } from '../accounts';
|
|
11
|
-
import { getAdvanceNonceAccountInstruction, getAllocateInstruction, getAllocateWithSeedInstruction, getAssignInstruction, getAssignWithSeedInstruction, getAuthorizeNonceAccountInstruction, getCreateAccountInstruction, getCreateAccountWithSeedInstruction, getInitializeNonceAccountInstruction, getTransferSolInstruction, getTransferSolWithSeedInstruction, getUpgradeNonceAccountInstruction, getWithdrawNonceAccountInstruction, type AdvanceNonceAccountInput, type AllocateInput, type AllocateWithSeedInput, type AssignInput, type AssignWithSeedInput, type AuthorizeNonceAccountInput, type CreateAccountInput, type CreateAccountWithSeedInput, type InitializeNonceAccountInput, type ParsedAdvanceNonceAccountInstruction, type ParsedAllocateInstruction, type ParsedAllocateWithSeedInstruction, type ParsedAssignInstruction, type ParsedAssignWithSeedInstruction, type ParsedAuthorizeNonceAccountInstruction, type ParsedCreateAccountInstruction, type ParsedCreateAccountWithSeedInstruction, type ParsedInitializeNonceAccountInstruction, type ParsedTransferSolInstruction, type ParsedTransferSolWithSeedInstruction, type ParsedUpgradeNonceAccountInstruction, type ParsedWithdrawNonceAccountInstruction, type TransferSolInput, type TransferSolWithSeedInput, type UpgradeNonceAccountInput, type WithdrawNonceAccountInput } from '../instructions';
|
|
11
|
+
import { getAdvanceNonceAccountInstruction, getAllocateInstruction, getAllocateWithSeedInstruction, getAssignInstruction, getAssignWithSeedInstruction, getAuthorizeNonceAccountInstruction, getCreateAccountAllowPrefundInstruction, getCreateAccountInstruction, getCreateAccountWithSeedInstruction, getInitializeNonceAccountInstruction, getTransferSolInstruction, getTransferSolWithSeedInstruction, getUpgradeNonceAccountInstruction, getWithdrawNonceAccountInstruction, type AdvanceNonceAccountInput, type AllocateInput, type AllocateWithSeedInput, type AssignInput, type AssignWithSeedInput, type AuthorizeNonceAccountInput, type CreateAccountAllowPrefundInput, type CreateAccountInput, type CreateAccountWithSeedInput, type InitializeNonceAccountInput, type ParsedAdvanceNonceAccountInstruction, type ParsedAllocateInstruction, type ParsedAllocateWithSeedInstruction, type ParsedAssignInstruction, type ParsedAssignWithSeedInstruction, type ParsedAuthorizeNonceAccountInstruction, type ParsedCreateAccountAllowPrefundInstruction, type ParsedCreateAccountInstruction, type ParsedCreateAccountWithSeedInstruction, type ParsedInitializeNonceAccountInstruction, type ParsedTransferSolInstruction, type ParsedTransferSolWithSeedInstruction, type ParsedUpgradeNonceAccountInstruction, type ParsedWithdrawNonceAccountInstruction, type TransferSolInput, type TransferSolWithSeedInput, type UpgradeNonceAccountInput, type WithdrawNonceAccountInput } from '../instructions';
|
|
12
12
|
export declare const SYSTEM_PROGRAM_ADDRESS: Address<"11111111111111111111111111111111">;
|
|
13
13
|
export declare enum SystemAccount {
|
|
14
14
|
Nonce = 0
|
|
@@ -26,7 +26,8 @@ export declare enum SystemInstruction {
|
|
|
26
26
|
AllocateWithSeed = 9,
|
|
27
27
|
AssignWithSeed = 10,
|
|
28
28
|
TransferSolWithSeed = 11,
|
|
29
|
-
UpgradeNonceAccount = 12
|
|
29
|
+
UpgradeNonceAccount = 12,
|
|
30
|
+
CreateAccountAllowPrefund = 13
|
|
30
31
|
}
|
|
31
32
|
export declare function identifySystemInstruction(instruction: {
|
|
32
33
|
data: ReadonlyUint8Array;
|
|
@@ -57,7 +58,9 @@ export type ParsedSystemInstruction<TProgram extends string = '11111111111111111
|
|
|
57
58
|
instructionType: SystemInstruction.TransferSolWithSeed;
|
|
58
59
|
} & ParsedTransferSolWithSeedInstruction<TProgram>) | ({
|
|
59
60
|
instructionType: SystemInstruction.UpgradeNonceAccount;
|
|
60
|
-
} & ParsedUpgradeNonceAccountInstruction<TProgram>)
|
|
61
|
+
} & ParsedUpgradeNonceAccountInstruction<TProgram>) | ({
|
|
62
|
+
instructionType: SystemInstruction.CreateAccountAllowPrefund;
|
|
63
|
+
} & ParsedCreateAccountAllowPrefundInstruction<TProgram>);
|
|
61
64
|
export declare function parseSystemInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedSystemInstruction<TProgram>;
|
|
62
65
|
export type SystemPlugin = {
|
|
63
66
|
accounts: SystemPluginAccounts;
|
|
@@ -80,6 +83,7 @@ export type SystemPluginInstructions = {
|
|
|
80
83
|
assignWithSeed: (input: AssignWithSeedInput) => ReturnType<typeof getAssignWithSeedInstruction> & SelfPlanAndSendFunctions;
|
|
81
84
|
transferSolWithSeed: (input: TransferSolWithSeedInput) => ReturnType<typeof getTransferSolWithSeedInstruction> & SelfPlanAndSendFunctions;
|
|
82
85
|
upgradeNonceAccount: (input: UpgradeNonceAccountInput) => ReturnType<typeof getUpgradeNonceAccountInstruction> & SelfPlanAndSendFunctions;
|
|
86
|
+
createAccountAllowPrefund: (input: CreateAccountAllowPrefundInput) => ReturnType<typeof getCreateAccountAllowPrefundInstruction> & SelfPlanAndSendFunctions;
|
|
83
87
|
};
|
|
84
88
|
export type SystemPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> & ClientWithPayer & ClientWithTransactionPlanning & ClientWithTransactionSending;
|
|
85
89
|
export declare function systemProgram(): <T extends SystemPluginRequirements>(client: T) => Omit<T, "system"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/generated/programs/system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAQH,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAGH,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EACH,iCAAiC,EACjC,sBAAsB,EACtB,8BAA8B,EAC9B,oBAAoB,EACpB,4BAA4B,EAC5B,mCAAmC,EACnC,2BAA2B,EAC3B,mCAAmC,EACnC,oCAAoC,EACpC,yBAAyB,EACzB,iCAAiC,EACjC,iCAAiC,EACjC,kCAAkC,
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/generated/programs/system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAQH,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAGH,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE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AC9F,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,iBAAiB,GAAG,sBAAsB,CAAC,GAC5F,eAAe,GACf,6BAA6B,GAC7B,4BAA4B,CAAC;AAEjC,wBAAgB,aAAa,KACjB,CAAC,SAAS,wBAAwB,EAAE,QAAQ,CAAC,KAAG,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAuCvG;AAED,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
BASE_ACCOUNT_SIZE,
|
|
11
|
+
combineCodec,
|
|
12
|
+
getAddressDecoder,
|
|
13
|
+
getAddressEncoder,
|
|
14
|
+
getStructDecoder,
|
|
15
|
+
getStructEncoder,
|
|
16
|
+
getU32Decoder,
|
|
17
|
+
getU32Encoder,
|
|
18
|
+
getU64Decoder,
|
|
19
|
+
getU64Encoder,
|
|
20
|
+
SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
21
|
+
SolanaError,
|
|
22
|
+
transformEncoder,
|
|
23
|
+
type AccountMeta,
|
|
24
|
+
type AccountSignerMeta,
|
|
25
|
+
type Address,
|
|
26
|
+
type FixedSizeCodec,
|
|
27
|
+
type FixedSizeDecoder,
|
|
28
|
+
type FixedSizeEncoder,
|
|
29
|
+
type Instruction,
|
|
30
|
+
type InstructionWithAccounts,
|
|
31
|
+
type InstructionWithData,
|
|
32
|
+
type ReadonlyUint8Array,
|
|
33
|
+
type TransactionSigner,
|
|
34
|
+
type WritableSignerAccount,
|
|
35
|
+
} from '@solana/kit';
|
|
36
|
+
import {
|
|
37
|
+
getAccountMetaFactory,
|
|
38
|
+
type InstructionWithByteDelta,
|
|
39
|
+
type ResolvedInstructionAccount,
|
|
40
|
+
} from '@solana/kit/program-client-core';
|
|
41
|
+
import { SYSTEM_PROGRAM_ADDRESS } from '../programs';
|
|
42
|
+
|
|
43
|
+
export const CREATE_ACCOUNT_ALLOW_PREFUND_DISCRIMINATOR = 13;
|
|
44
|
+
|
|
45
|
+
export function getCreateAccountAllowPrefundDiscriminatorBytes(): ReadonlyUint8Array {
|
|
46
|
+
return getU32Encoder().encode(CREATE_ACCOUNT_ALLOW_PREFUND_DISCRIMINATOR);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type CreateAccountAllowPrefundInstruction<
|
|
50
|
+
TProgram extends string = typeof SYSTEM_PROGRAM_ADDRESS,
|
|
51
|
+
TAccountNewAccount extends string | AccountMeta<string> = string,
|
|
52
|
+
TAccountPayer extends string | AccountMeta<string> | undefined = undefined,
|
|
53
|
+
TRemainingAccounts extends readonly AccountMeta<string>[] = [],
|
|
54
|
+
> = Instruction<TProgram> &
|
|
55
|
+
InstructionWithData<ReadonlyUint8Array> &
|
|
56
|
+
InstructionWithAccounts<
|
|
57
|
+
[
|
|
58
|
+
TAccountNewAccount extends string
|
|
59
|
+
? WritableSignerAccount<TAccountNewAccount> & AccountSignerMeta<TAccountNewAccount>
|
|
60
|
+
: TAccountNewAccount,
|
|
61
|
+
...(TAccountPayer extends undefined
|
|
62
|
+
? []
|
|
63
|
+
: [
|
|
64
|
+
TAccountPayer extends string
|
|
65
|
+
? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>
|
|
66
|
+
: TAccountPayer,
|
|
67
|
+
]),
|
|
68
|
+
...TRemainingAccounts,
|
|
69
|
+
]
|
|
70
|
+
>;
|
|
71
|
+
|
|
72
|
+
export type CreateAccountAllowPrefundInstructionData = {
|
|
73
|
+
discriminator: number;
|
|
74
|
+
lamports: bigint;
|
|
75
|
+
space: bigint;
|
|
76
|
+
programAddress: Address;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type CreateAccountAllowPrefundInstructionDataArgs = {
|
|
80
|
+
lamports?: number | bigint;
|
|
81
|
+
space: number | bigint;
|
|
82
|
+
programAddress: Address;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export function getCreateAccountAllowPrefundInstructionDataEncoder(): FixedSizeEncoder<CreateAccountAllowPrefundInstructionDataArgs> {
|
|
86
|
+
return transformEncoder(
|
|
87
|
+
getStructEncoder([
|
|
88
|
+
['discriminator', getU32Encoder()],
|
|
89
|
+
['lamports', getU64Encoder()],
|
|
90
|
+
['space', getU64Encoder()],
|
|
91
|
+
['programAddress', getAddressEncoder()],
|
|
92
|
+
]),
|
|
93
|
+
value => ({
|
|
94
|
+
...value,
|
|
95
|
+
discriminator: CREATE_ACCOUNT_ALLOW_PREFUND_DISCRIMINATOR,
|
|
96
|
+
lamports: value.lamports ?? 0,
|
|
97
|
+
}),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function getCreateAccountAllowPrefundInstructionDataDecoder(): FixedSizeDecoder<CreateAccountAllowPrefundInstructionData> {
|
|
102
|
+
return getStructDecoder([
|
|
103
|
+
['discriminator', getU32Decoder()],
|
|
104
|
+
['lamports', getU64Decoder()],
|
|
105
|
+
['space', getU64Decoder()],
|
|
106
|
+
['programAddress', getAddressDecoder()],
|
|
107
|
+
]);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function getCreateAccountAllowPrefundInstructionDataCodec(): FixedSizeCodec<
|
|
111
|
+
CreateAccountAllowPrefundInstructionDataArgs,
|
|
112
|
+
CreateAccountAllowPrefundInstructionData
|
|
113
|
+
> {
|
|
114
|
+
return combineCodec(
|
|
115
|
+
getCreateAccountAllowPrefundInstructionDataEncoder(),
|
|
116
|
+
getCreateAccountAllowPrefundInstructionDataDecoder(),
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type CreateAccountAllowPrefundInput<
|
|
121
|
+
TAccountNewAccount extends string = string,
|
|
122
|
+
TAccountPayer extends string = string,
|
|
123
|
+
> = {
|
|
124
|
+
newAccount: TransactionSigner<TAccountNewAccount>;
|
|
125
|
+
payer?: TransactionSigner<TAccountPayer>;
|
|
126
|
+
lamports?: CreateAccountAllowPrefundInstructionDataArgs['lamports'];
|
|
127
|
+
space: CreateAccountAllowPrefundInstructionDataArgs['space'];
|
|
128
|
+
programAddress: CreateAccountAllowPrefundInstructionDataArgs['programAddress'];
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export function getCreateAccountAllowPrefundInstruction<
|
|
132
|
+
TAccountNewAccount extends string,
|
|
133
|
+
TAccountPayer extends string,
|
|
134
|
+
TProgramAddress extends Address = typeof SYSTEM_PROGRAM_ADDRESS,
|
|
135
|
+
>(
|
|
136
|
+
input: CreateAccountAllowPrefundInput<TAccountNewAccount, TAccountPayer>,
|
|
137
|
+
config?: { programAddress?: TProgramAddress },
|
|
138
|
+
): CreateAccountAllowPrefundInstruction<TProgramAddress, TAccountNewAccount, TAccountPayer> & InstructionWithByteDelta {
|
|
139
|
+
// Program address.
|
|
140
|
+
const programAddress = config?.programAddress ?? SYSTEM_PROGRAM_ADDRESS;
|
|
141
|
+
|
|
142
|
+
// Original accounts.
|
|
143
|
+
const originalAccounts = {
|
|
144
|
+
newAccount: { value: input.newAccount ?? null, isWritable: true },
|
|
145
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
146
|
+
};
|
|
147
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
148
|
+
|
|
149
|
+
// Original args.
|
|
150
|
+
const args = { ...input };
|
|
151
|
+
|
|
152
|
+
// Bytes created or reallocated by the instruction.
|
|
153
|
+
const byteDelta: number = [Number(args.space) + BASE_ACCOUNT_SIZE].reduce((a, b) => a + b, 0);
|
|
154
|
+
|
|
155
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');
|
|
156
|
+
return Object.freeze({
|
|
157
|
+
accounts: [getAccountMeta('newAccount', accounts.newAccount), getAccountMeta('payer', accounts.payer)].filter(
|
|
158
|
+
<T>(x: T | undefined): x is T => x !== undefined,
|
|
159
|
+
),
|
|
160
|
+
byteDelta,
|
|
161
|
+
data: getCreateAccountAllowPrefundInstructionDataEncoder().encode(
|
|
162
|
+
args as CreateAccountAllowPrefundInstructionDataArgs,
|
|
163
|
+
),
|
|
164
|
+
programAddress,
|
|
165
|
+
} as CreateAccountAllowPrefundInstruction<TProgramAddress, TAccountNewAccount, TAccountPayer> &
|
|
166
|
+
InstructionWithByteDelta);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export type ParsedCreateAccountAllowPrefundInstruction<
|
|
170
|
+
TProgram extends string = typeof SYSTEM_PROGRAM_ADDRESS,
|
|
171
|
+
TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
|
|
172
|
+
> = {
|
|
173
|
+
programAddress: Address<TProgram>;
|
|
174
|
+
accounts: {
|
|
175
|
+
newAccount: TAccountMetas[0];
|
|
176
|
+
payer?: TAccountMetas[1] | undefined;
|
|
177
|
+
};
|
|
178
|
+
data: CreateAccountAllowPrefundInstructionData;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export function parseCreateAccountAllowPrefundInstruction<
|
|
182
|
+
TProgram extends string,
|
|
183
|
+
TAccountMetas extends readonly AccountMeta[],
|
|
184
|
+
>(
|
|
185
|
+
instruction: Instruction<TProgram> &
|
|
186
|
+
InstructionWithAccounts<TAccountMetas> &
|
|
187
|
+
InstructionWithData<ReadonlyUint8Array>,
|
|
188
|
+
): ParsedCreateAccountAllowPrefundInstruction<TProgram, TAccountMetas> {
|
|
189
|
+
if (instruction.accounts.length < 1) {
|
|
190
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
191
|
+
actualAccountMetas: instruction.accounts.length,
|
|
192
|
+
expectedAccountMetas: 1,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
let accountIndex = 0;
|
|
196
|
+
const getNextAccount = () => {
|
|
197
|
+
const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
|
|
198
|
+
accountIndex += 1;
|
|
199
|
+
return accountMeta;
|
|
200
|
+
};
|
|
201
|
+
let optionalAccountsRemaining = instruction.accounts.length - 1;
|
|
202
|
+
const getNextOptionalAccount = () => {
|
|
203
|
+
if (optionalAccountsRemaining === 0) return undefined;
|
|
204
|
+
optionalAccountsRemaining -= 1;
|
|
205
|
+
return getNextAccount();
|
|
206
|
+
};
|
|
207
|
+
return {
|
|
208
|
+
programAddress: instruction.programAddress,
|
|
209
|
+
accounts: { newAccount: getNextAccount(), payer: getNextOptionalAccount() },
|
|
210
|
+
data: getCreateAccountAllowPrefundInstructionDataDecoder().decode(instruction.data),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
@@ -13,6 +13,7 @@ export * from './assign';
|
|
|
13
13
|
export * from './assignWithSeed';
|
|
14
14
|
export * from './authorizeNonceAccount';
|
|
15
15
|
export * from './createAccount';
|
|
16
|
+
export * from './createAccountAllowPrefund';
|
|
16
17
|
export * from './createAccountWithSeed';
|
|
17
18
|
export * from './initializeNonceAccount';
|
|
18
19
|
export * from './transferSol';
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
getAssignInstruction,
|
|
40
40
|
getAssignWithSeedInstruction,
|
|
41
41
|
getAuthorizeNonceAccountInstruction,
|
|
42
|
+
getCreateAccountAllowPrefundInstruction,
|
|
42
43
|
getCreateAccountInstruction,
|
|
43
44
|
getCreateAccountWithSeedInstruction,
|
|
44
45
|
getInitializeNonceAccountInstruction,
|
|
@@ -52,6 +53,7 @@ import {
|
|
|
52
53
|
parseAssignInstruction,
|
|
53
54
|
parseAssignWithSeedInstruction,
|
|
54
55
|
parseAuthorizeNonceAccountInstruction,
|
|
56
|
+
parseCreateAccountAllowPrefundInstruction,
|
|
55
57
|
parseCreateAccountInstruction,
|
|
56
58
|
parseCreateAccountWithSeedInstruction,
|
|
57
59
|
parseInitializeNonceAccountInstruction,
|
|
@@ -65,6 +67,7 @@ import {
|
|
|
65
67
|
type AssignInput,
|
|
66
68
|
type AssignWithSeedInput,
|
|
67
69
|
type AuthorizeNonceAccountInput,
|
|
70
|
+
type CreateAccountAllowPrefundInput,
|
|
68
71
|
type CreateAccountInput,
|
|
69
72
|
type CreateAccountWithSeedInput,
|
|
70
73
|
type InitializeNonceAccountInput,
|
|
@@ -74,6 +77,7 @@ import {
|
|
|
74
77
|
type ParsedAssignInstruction,
|
|
75
78
|
type ParsedAssignWithSeedInstruction,
|
|
76
79
|
type ParsedAuthorizeNonceAccountInstruction,
|
|
80
|
+
type ParsedCreateAccountAllowPrefundInstruction,
|
|
77
81
|
type ParsedCreateAccountInstruction,
|
|
78
82
|
type ParsedCreateAccountWithSeedInstruction,
|
|
79
83
|
type ParsedInitializeNonceAccountInstruction,
|
|
@@ -107,6 +111,7 @@ export enum SystemInstruction {
|
|
|
107
111
|
AssignWithSeed,
|
|
108
112
|
TransferSolWithSeed,
|
|
109
113
|
UpgradeNonceAccount,
|
|
114
|
+
CreateAccountAllowPrefund,
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
export function identifySystemInstruction(
|
|
@@ -152,6 +157,9 @@ export function identifySystemInstruction(
|
|
|
152
157
|
if (containsBytes(data, getU32Encoder().encode(12), 0)) {
|
|
153
158
|
return SystemInstruction.UpgradeNonceAccount;
|
|
154
159
|
}
|
|
160
|
+
if (containsBytes(data, getU32Encoder().encode(13), 0)) {
|
|
161
|
+
return SystemInstruction.CreateAccountAllowPrefund;
|
|
162
|
+
}
|
|
155
163
|
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
|
|
156
164
|
instructionData: data,
|
|
157
165
|
programName: 'system',
|
|
@@ -173,7 +181,10 @@ export type ParsedSystemInstruction<TProgram extends string = '11111111111111111
|
|
|
173
181
|
| ({ instructionType: SystemInstruction.AllocateWithSeed } & ParsedAllocateWithSeedInstruction<TProgram>)
|
|
174
182
|
| ({ instructionType: SystemInstruction.AssignWithSeed } & ParsedAssignWithSeedInstruction<TProgram>)
|
|
175
183
|
| ({ instructionType: SystemInstruction.TransferSolWithSeed } & ParsedTransferSolWithSeedInstruction<TProgram>)
|
|
176
|
-
| ({ instructionType: SystemInstruction.UpgradeNonceAccount } & ParsedUpgradeNonceAccountInstruction<TProgram>)
|
|
184
|
+
| ({ instructionType: SystemInstruction.UpgradeNonceAccount } & ParsedUpgradeNonceAccountInstruction<TProgram>)
|
|
185
|
+
| ({
|
|
186
|
+
instructionType: SystemInstruction.CreateAccountAllowPrefund;
|
|
187
|
+
} & ParsedCreateAccountAllowPrefundInstruction<TProgram>);
|
|
177
188
|
|
|
178
189
|
export function parseSystemInstruction<TProgram extends string>(
|
|
179
190
|
instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,
|
|
@@ -259,6 +270,13 @@ export function parseSystemInstruction<TProgram extends string>(
|
|
|
259
270
|
...parseUpgradeNonceAccountInstruction(instruction),
|
|
260
271
|
};
|
|
261
272
|
}
|
|
273
|
+
case SystemInstruction.CreateAccountAllowPrefund: {
|
|
274
|
+
assertIsInstructionWithAccounts(instruction);
|
|
275
|
+
return {
|
|
276
|
+
instructionType: SystemInstruction.CreateAccountAllowPrefund,
|
|
277
|
+
...parseCreateAccountAllowPrefundInstruction(instruction),
|
|
278
|
+
};
|
|
279
|
+
}
|
|
262
280
|
default:
|
|
263
281
|
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
|
|
264
282
|
instructionType: instructionType as string,
|
|
@@ -305,6 +323,9 @@ export type SystemPluginInstructions = {
|
|
|
305
323
|
upgradeNonceAccount: (
|
|
306
324
|
input: UpgradeNonceAccountInput,
|
|
307
325
|
) => ReturnType<typeof getUpgradeNonceAccountInstruction> & SelfPlanAndSendFunctions;
|
|
326
|
+
createAccountAllowPrefund: (
|
|
327
|
+
input: CreateAccountAllowPrefundInput,
|
|
328
|
+
) => ReturnType<typeof getCreateAccountAllowPrefundInstruction> & SelfPlanAndSendFunctions;
|
|
308
329
|
};
|
|
309
330
|
|
|
310
331
|
export type SystemPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> &
|
|
@@ -346,6 +367,8 @@ export function systemProgram() {
|
|
|
346
367
|
addSelfPlanAndSendFunctions(client, getTransferSolWithSeedInstruction(input)),
|
|
347
368
|
upgradeNonceAccount: input =>
|
|
348
369
|
addSelfPlanAndSendFunctions(client, getUpgradeNonceAccountInstruction(input)),
|
|
370
|
+
createAccountAllowPrefund: input =>
|
|
371
|
+
addSelfPlanAndSendFunctions(client, getCreateAccountAllowPrefundInstruction(input)),
|
|
349
372
|
},
|
|
350
373
|
},
|
|
351
374
|
});
|