fortis-multisig-client 0.1.0 → 0.1.1
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/generated/accounts/index.d.ts +10 -0
- package/dist/generated/accounts/index.js +10 -0
- package/dist/generated/accounts/multisig.d.ts +51 -0
- package/dist/generated/accounts/multisig.js +52 -0
- package/dist/generated/accounts/proposal.d.ts +49 -0
- package/dist/generated/accounts/proposal.js +54 -0
- package/dist/generated/accounts/vaultTransaction.d.ts +66 -0
- package/dist/generated/accounts/vaultTransaction.js +61 -0
- package/dist/generated/index.d.ts +11 -0
- package/dist/generated/index.js +11 -0
- package/dist/generated/instructions/index.d.ts +12 -0
- package/dist/generated/instructions/index.js +12 -0
- package/dist/generated/instructions/multisigCreate.d.ts +65 -0
- package/dist/generated/instructions/multisigCreate.js +80 -0
- package/dist/generated/instructions/proposalAccountsClose.d.ts +54 -0
- package/dist/generated/instructions/proposalAccountsClose.js +76 -0
- package/dist/generated/instructions/proposalApprove.d.ts +47 -0
- package/dist/generated/instructions/proposalApprove.js +74 -0
- package/dist/generated/instructions/proposalCreate.d.ts +57 -0
- package/dist/generated/instructions/proposalCreate.js +80 -0
- package/dist/generated/instructions/proposalExecute.d.ts +49 -0
- package/dist/generated/instructions/proposalExecute.js +70 -0
- package/dist/generated/programs/fortisMultisig.d.ts +36 -0
- package/dist/generated/programs/fortisMultisig.js +42 -0
- package/dist/generated/programs/index.d.ts +8 -0
- package/dist/generated/programs/index.js +8 -0
- package/dist/generated/shared/index.d.ts +49 -0
- package/dist/generated/shared/index.js +86 -0
- package/dist/generated/types/compiledInstruction.d.ts +20 -0
- package/dist/generated/types/compiledInstruction.js +31 -0
- package/dist/generated/types/index.d.ts +13 -0
- package/dist/generated/types/index.js +13 -0
- package/dist/generated/types/messageAddressTableLookup.d.ts +24 -0
- package/dist/generated/types/messageAddressTableLookup.js +37 -0
- package/dist/generated/types/multisigCreateArgs.d.ts +33 -0
- package/dist/generated/types/multisigCreateArgs.js +25 -0
- package/dist/generated/types/proposalApproveArgs.d.ts +13 -0
- package/dist/generated/types/proposalApproveArgs.js +17 -0
- package/dist/generated/types/proposalCreateArgs.d.ts +25 -0
- package/dist/generated/types/proposalCreateArgs.js +31 -0
- package/dist/generated/types/vaultTransactionMessage.d.ts +68 -0
- package/dist/generated/types/vaultTransactionMessage.js +38 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +7 -0
- package/dist/instructions/index.d.ts +12 -0
- package/dist/instructions/index.js +12 -0
- package/dist/instructions/multisigCreate.d.ts +10 -0
- package/dist/instructions/multisigCreate.js +26 -0
- package/dist/instructions/proposalAccountsClose.d.ts +6 -0
- package/dist/instructions/proposalAccountsClose.js +19 -0
- package/dist/instructions/proposalApprove.d.ts +6 -0
- package/dist/instructions/proposalApprove.js +15 -0
- package/dist/instructions/proposalCreate.d.ts +10 -0
- package/dist/instructions/proposalCreate.js +27 -0
- package/dist/instructions/proposalExecute.d.ts +10 -0
- package/dist/instructions/proposalExecute.js +39 -0
- package/dist/pda.d.ts +27 -0
- package/dist/pda.js +41 -0
- package/dist/utils/compileToWrappedMessageV0.d.ts +11 -0
- package/dist/utils/compileToWrappedMessageV0.js +29 -0
- package/dist/utils/compiled-keys.d.ts +27 -0
- package/dist/utils/compiled-keys.js +112 -0
- package/dist/utils.d.ts +28 -0
- package/dist/utils.js +184 -0
- package/package.json +2 -2
|
@@ -0,0 +1,76 @@
|
|
|
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 { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { getAccountMetaFactory } from '../shared';
|
|
11
|
+
export const PROPOSAL_ACCOUNTS_CLOSE_DISCRIMINATOR = new Uint8Array([4]);
|
|
12
|
+
export function getProposalAccountsCloseDiscriminatorBytes() {
|
|
13
|
+
return fixEncoderSize(getBytesEncoder(), 1).encode(PROPOSAL_ACCOUNTS_CLOSE_DISCRIMINATOR);
|
|
14
|
+
}
|
|
15
|
+
export function getProposalAccountsCloseInstructionDataEncoder() {
|
|
16
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 1)]]), (value) => ({
|
|
17
|
+
...value,
|
|
18
|
+
discriminator: PROPOSAL_ACCOUNTS_CLOSE_DISCRIMINATOR,
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
export function getProposalAccountsCloseInstructionDataDecoder() {
|
|
22
|
+
return getStructDecoder([
|
|
23
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 1)],
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
export function getProposalAccountsCloseInstructionDataCodec() {
|
|
27
|
+
return combineCodec(getProposalAccountsCloseInstructionDataEncoder(), getProposalAccountsCloseInstructionDataDecoder());
|
|
28
|
+
}
|
|
29
|
+
export function getProposalAccountsCloseInstruction(input, config) {
|
|
30
|
+
// Program address.
|
|
31
|
+
const programAddress = config?.programAddress ?? FORTIS_MULTISIG_PROGRAM_ADDRESS;
|
|
32
|
+
// Original accounts.
|
|
33
|
+
const originalAccounts = {
|
|
34
|
+
multisig: { value: input.multisig ?? null, isWritable: false },
|
|
35
|
+
proposal: { value: input.proposal ?? null, isWritable: true },
|
|
36
|
+
transaction: { value: input.transaction ?? null, isWritable: true },
|
|
37
|
+
rentCollector: { value: input.rentCollector ?? null, isWritable: true },
|
|
38
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
39
|
+
};
|
|
40
|
+
const accounts = originalAccounts;
|
|
41
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
42
|
+
return Object.freeze({
|
|
43
|
+
accounts: [
|
|
44
|
+
getAccountMeta(accounts.multisig),
|
|
45
|
+
getAccountMeta(accounts.proposal),
|
|
46
|
+
getAccountMeta(accounts.transaction),
|
|
47
|
+
getAccountMeta(accounts.rentCollector),
|
|
48
|
+
getAccountMeta(accounts.systemProgram),
|
|
49
|
+
],
|
|
50
|
+
data: getProposalAccountsCloseInstructionDataEncoder().encode({}),
|
|
51
|
+
programAddress,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export function parseProposalAccountsCloseInstruction(instruction) {
|
|
55
|
+
if (instruction.accounts.length < 5) {
|
|
56
|
+
// TODO: Coded error.
|
|
57
|
+
throw new Error('Not enough accounts');
|
|
58
|
+
}
|
|
59
|
+
let accountIndex = 0;
|
|
60
|
+
const getNextAccount = () => {
|
|
61
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
62
|
+
accountIndex += 1;
|
|
63
|
+
return accountMeta;
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
programAddress: instruction.programAddress,
|
|
67
|
+
accounts: {
|
|
68
|
+
multisig: getNextAccount(),
|
|
69
|
+
proposal: getNextAccount(),
|
|
70
|
+
transaction: getNextAccount(),
|
|
71
|
+
rentCollector: getNextAccount(),
|
|
72
|
+
systemProgram: getNextAccount(),
|
|
73
|
+
},
|
|
74
|
+
data: getProposalAccountsCloseInstructionDataDecoder().decode(instruction.data),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount, type WritableSignerAccount } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { type ProposalApproveArgs, type ProposalApproveArgsArgs } from '../types';
|
|
11
|
+
export declare const PROPOSAL_APPROVE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
12
|
+
export declare function getProposalApproveDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
+
export type ProposalApproveInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountMultisig extends string | AccountMeta<string> = string, TAccountProposal extends string | AccountMeta<string> = string, TAccountMember extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
14
|
+
TAccountMultisig extends string ? ReadonlyAccount<TAccountMultisig> : TAccountMultisig,
|
|
15
|
+
TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
|
|
16
|
+
TAccountMember extends string ? WritableSignerAccount<TAccountMember> & AccountSignerMeta<TAccountMember> : TAccountMember,
|
|
17
|
+
...TRemainingAccounts
|
|
18
|
+
]>;
|
|
19
|
+
export type ProposalApproveInstructionData = {
|
|
20
|
+
discriminator: ReadonlyUint8Array;
|
|
21
|
+
args: ProposalApproveArgs;
|
|
22
|
+
};
|
|
23
|
+
export type ProposalApproveInstructionDataArgs = {
|
|
24
|
+
args: ProposalApproveArgsArgs;
|
|
25
|
+
};
|
|
26
|
+
export declare function getProposalApproveInstructionDataEncoder(): FixedSizeEncoder<ProposalApproveInstructionDataArgs>;
|
|
27
|
+
export declare function getProposalApproveInstructionDataDecoder(): FixedSizeDecoder<ProposalApproveInstructionData>;
|
|
28
|
+
export declare function getProposalApproveInstructionDataCodec(): FixedSizeCodec<ProposalApproveInstructionDataArgs, ProposalApproveInstructionData>;
|
|
29
|
+
export type ProposalApproveInput<TAccountMultisig extends string = string, TAccountProposal extends string = string, TAccountMember extends string = string> = {
|
|
30
|
+
multisig: Address<TAccountMultisig>;
|
|
31
|
+
proposal: Address<TAccountProposal>;
|
|
32
|
+
member: Address<TAccountMember>;
|
|
33
|
+
args: ProposalApproveInstructionDataArgs['args'];
|
|
34
|
+
};
|
|
35
|
+
export declare function getProposalApproveInstruction<TAccountMultisig extends string, TAccountProposal extends string, TAccountMember extends string, TProgramAddress extends Address = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS>(input: ProposalApproveInput<TAccountMultisig, TAccountProposal, TAccountMember>, config?: {
|
|
36
|
+
programAddress?: TProgramAddress;
|
|
37
|
+
}): ProposalApproveInstruction<TProgramAddress, TAccountMultisig, TAccountProposal, TAccountMember>;
|
|
38
|
+
export type ParsedProposalApproveInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
39
|
+
programAddress: Address<TProgram>;
|
|
40
|
+
accounts: {
|
|
41
|
+
multisig: TAccountMetas[0];
|
|
42
|
+
proposal: TAccountMetas[1];
|
|
43
|
+
member: TAccountMetas[2];
|
|
44
|
+
};
|
|
45
|
+
data: ProposalApproveInstructionData;
|
|
46
|
+
};
|
|
47
|
+
export declare function parseProposalApproveInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedProposalApproveInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { getAccountMetaFactory } from '../shared';
|
|
11
|
+
import { getProposalApproveArgsDecoder, getProposalApproveArgsEncoder, } from '../types';
|
|
12
|
+
export const PROPOSAL_APPROVE_DISCRIMINATOR = new Uint8Array([2]);
|
|
13
|
+
export function getProposalApproveDiscriminatorBytes() {
|
|
14
|
+
return fixEncoderSize(getBytesEncoder(), 1).encode(PROPOSAL_APPROVE_DISCRIMINATOR);
|
|
15
|
+
}
|
|
16
|
+
export function getProposalApproveInstructionDataEncoder() {
|
|
17
|
+
return transformEncoder(getStructEncoder([
|
|
18
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 1)],
|
|
19
|
+
['args', getProposalApproveArgsEncoder()],
|
|
20
|
+
]), (value) => ({ ...value, discriminator: PROPOSAL_APPROVE_DISCRIMINATOR }));
|
|
21
|
+
}
|
|
22
|
+
export function getProposalApproveInstructionDataDecoder() {
|
|
23
|
+
return getStructDecoder([
|
|
24
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 1)],
|
|
25
|
+
['args', getProposalApproveArgsDecoder()],
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
export function getProposalApproveInstructionDataCodec() {
|
|
29
|
+
return combineCodec(getProposalApproveInstructionDataEncoder(), getProposalApproveInstructionDataDecoder());
|
|
30
|
+
}
|
|
31
|
+
export function getProposalApproveInstruction(input, config) {
|
|
32
|
+
// Program address.
|
|
33
|
+
const programAddress = config?.programAddress ?? FORTIS_MULTISIG_PROGRAM_ADDRESS;
|
|
34
|
+
// Original accounts.
|
|
35
|
+
const originalAccounts = {
|
|
36
|
+
multisig: { value: input.multisig ?? null, isWritable: false },
|
|
37
|
+
proposal: { value: input.proposal ?? null, isWritable: true },
|
|
38
|
+
member: { value: input.member ?? null, isWritable: true },
|
|
39
|
+
};
|
|
40
|
+
const accounts = originalAccounts;
|
|
41
|
+
// Original args.
|
|
42
|
+
const args = { ...input };
|
|
43
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
accounts: [
|
|
46
|
+
getAccountMeta(accounts.multisig),
|
|
47
|
+
getAccountMeta(accounts.proposal),
|
|
48
|
+
getAccountMeta(accounts.member),
|
|
49
|
+
],
|
|
50
|
+
data: getProposalApproveInstructionDataEncoder().encode(args),
|
|
51
|
+
programAddress,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export function parseProposalApproveInstruction(instruction) {
|
|
55
|
+
if (instruction.accounts.length < 3) {
|
|
56
|
+
// TODO: Coded error.
|
|
57
|
+
throw new Error('Not enough accounts');
|
|
58
|
+
}
|
|
59
|
+
let accountIndex = 0;
|
|
60
|
+
const getNextAccount = () => {
|
|
61
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
62
|
+
accountIndex += 1;
|
|
63
|
+
return accountMeta;
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
programAddress: instruction.programAddress,
|
|
67
|
+
accounts: {
|
|
68
|
+
multisig: getNextAccount(),
|
|
69
|
+
proposal: getNextAccount(),
|
|
70
|
+
member: getNextAccount(),
|
|
71
|
+
},
|
|
72
|
+
data: getProposalApproveInstructionDataDecoder().decode(instruction.data),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type WritableAccount } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { type ProposalCreateArgs, type ProposalCreateArgsArgs } from '../types';
|
|
11
|
+
export declare const PROPOSAL_CREATE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
12
|
+
export declare function getProposalCreateDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
+
export type ProposalCreateInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountMultisig extends string | AccountMeta<string> = string, TAccountTransaction extends string | AccountMeta<string> = string, TAccountCreator extends string | AccountMeta<string> = string, TAccountProposal extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
14
|
+
TAccountMultisig extends string ? WritableAccount<TAccountMultisig> : TAccountMultisig,
|
|
15
|
+
TAccountTransaction extends string ? WritableAccount<TAccountTransaction> : TAccountTransaction,
|
|
16
|
+
TAccountCreator extends string ? ReadonlySignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator,
|
|
17
|
+
TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
|
|
18
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
19
|
+
...TRemainingAccounts
|
|
20
|
+
]>;
|
|
21
|
+
export type ProposalCreateInstructionData = {
|
|
22
|
+
discriminator: ReadonlyUint8Array;
|
|
23
|
+
args: ProposalCreateArgs;
|
|
24
|
+
};
|
|
25
|
+
export type ProposalCreateInstructionDataArgs = {
|
|
26
|
+
args: ProposalCreateArgsArgs;
|
|
27
|
+
};
|
|
28
|
+
export declare function getProposalCreateInstructionDataEncoder(): Encoder<ProposalCreateInstructionDataArgs>;
|
|
29
|
+
export declare function getProposalCreateInstructionDataDecoder(): Decoder<ProposalCreateInstructionData>;
|
|
30
|
+
export declare function getProposalCreateInstructionDataCodec(): Codec<ProposalCreateInstructionDataArgs, ProposalCreateInstructionData>;
|
|
31
|
+
export type ProposalCreateInput<TAccountMultisig extends string = string, TAccountTransaction extends string = string, TAccountCreator extends string = string, TAccountProposal extends string = string, TAccountSystemProgram extends string = string> = {
|
|
32
|
+
multisig: Address<TAccountMultisig>;
|
|
33
|
+
transaction: Address<TAccountTransaction>;
|
|
34
|
+
/** The member of the multisig that is creating the transaction. */
|
|
35
|
+
creator: Address<TAccountCreator>;
|
|
36
|
+
/** The proposal account associated with the transaction. */
|
|
37
|
+
proposal: Address<TAccountProposal>;
|
|
38
|
+
systemProgram: Address<TAccountSystemProgram>;
|
|
39
|
+
args: ProposalCreateInstructionDataArgs['args'];
|
|
40
|
+
};
|
|
41
|
+
export declare function getProposalCreateInstruction<TAccountMultisig extends string, TAccountTransaction extends string, TAccountCreator extends string, TAccountProposal extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS>(input: ProposalCreateInput<TAccountMultisig, TAccountTransaction, TAccountCreator, TAccountProposal, TAccountSystemProgram>, config?: {
|
|
42
|
+
programAddress?: TProgramAddress;
|
|
43
|
+
}): ProposalCreateInstruction<TProgramAddress, TAccountMultisig, TAccountTransaction, TAccountCreator, TAccountProposal, TAccountSystemProgram>;
|
|
44
|
+
export type ParsedProposalCreateInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
45
|
+
programAddress: Address<TProgram>;
|
|
46
|
+
accounts: {
|
|
47
|
+
multisig: TAccountMetas[0];
|
|
48
|
+
transaction: TAccountMetas[1];
|
|
49
|
+
/** The member of the multisig that is creating the transaction. */
|
|
50
|
+
creator: TAccountMetas[2];
|
|
51
|
+
/** The proposal account associated with the transaction. */
|
|
52
|
+
proposal: TAccountMetas[3];
|
|
53
|
+
systemProgram: TAccountMetas[4];
|
|
54
|
+
};
|
|
55
|
+
data: ProposalCreateInstructionData;
|
|
56
|
+
};
|
|
57
|
+
export declare function parseProposalCreateInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedProposalCreateInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { getAccountMetaFactory } from '../shared';
|
|
11
|
+
import { getProposalCreateArgsDecoder, getProposalCreateArgsEncoder, } from '../types';
|
|
12
|
+
export const PROPOSAL_CREATE_DISCRIMINATOR = new Uint8Array([1]);
|
|
13
|
+
export function getProposalCreateDiscriminatorBytes() {
|
|
14
|
+
return fixEncoderSize(getBytesEncoder(), 1).encode(PROPOSAL_CREATE_DISCRIMINATOR);
|
|
15
|
+
}
|
|
16
|
+
export function getProposalCreateInstructionDataEncoder() {
|
|
17
|
+
return transformEncoder(getStructEncoder([
|
|
18
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 1)],
|
|
19
|
+
['args', getProposalCreateArgsEncoder()],
|
|
20
|
+
]), (value) => ({ ...value, discriminator: PROPOSAL_CREATE_DISCRIMINATOR }));
|
|
21
|
+
}
|
|
22
|
+
export function getProposalCreateInstructionDataDecoder() {
|
|
23
|
+
return getStructDecoder([
|
|
24
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 1)],
|
|
25
|
+
['args', getProposalCreateArgsDecoder()],
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
export function getProposalCreateInstructionDataCodec() {
|
|
29
|
+
return combineCodec(getProposalCreateInstructionDataEncoder(), getProposalCreateInstructionDataDecoder());
|
|
30
|
+
}
|
|
31
|
+
export function getProposalCreateInstruction(input, config) {
|
|
32
|
+
// Program address.
|
|
33
|
+
const programAddress = config?.programAddress ?? FORTIS_MULTISIG_PROGRAM_ADDRESS;
|
|
34
|
+
// Original accounts.
|
|
35
|
+
const originalAccounts = {
|
|
36
|
+
multisig: { value: input.multisig ?? null, isWritable: true },
|
|
37
|
+
transaction: { value: input.transaction ?? null, isWritable: true },
|
|
38
|
+
creator: { value: input.creator ?? null, isWritable: false },
|
|
39
|
+
proposal: { value: input.proposal ?? null, isWritable: true },
|
|
40
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
41
|
+
};
|
|
42
|
+
const accounts = originalAccounts;
|
|
43
|
+
// Original args.
|
|
44
|
+
const args = { ...input };
|
|
45
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
46
|
+
return Object.freeze({
|
|
47
|
+
accounts: [
|
|
48
|
+
getAccountMeta(accounts.multisig),
|
|
49
|
+
getAccountMeta(accounts.transaction),
|
|
50
|
+
getAccountMeta(accounts.creator),
|
|
51
|
+
getAccountMeta(accounts.proposal),
|
|
52
|
+
getAccountMeta(accounts.systemProgram),
|
|
53
|
+
],
|
|
54
|
+
data: getProposalCreateInstructionDataEncoder().encode(args),
|
|
55
|
+
programAddress,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export function parseProposalCreateInstruction(instruction) {
|
|
59
|
+
if (instruction.accounts.length < 5) {
|
|
60
|
+
// TODO: Coded error.
|
|
61
|
+
throw new Error('Not enough accounts');
|
|
62
|
+
}
|
|
63
|
+
let accountIndex = 0;
|
|
64
|
+
const getNextAccount = () => {
|
|
65
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
66
|
+
accountIndex += 1;
|
|
67
|
+
return accountMeta;
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
programAddress: instruction.programAddress,
|
|
71
|
+
accounts: {
|
|
72
|
+
multisig: getNextAccount(),
|
|
73
|
+
transaction: getNextAccount(),
|
|
74
|
+
creator: getNextAccount(),
|
|
75
|
+
proposal: getNextAccount(),
|
|
76
|
+
systemProgram: getNextAccount(),
|
|
77
|
+
},
|
|
78
|
+
data: getProposalCreateInstructionDataDecoder().decode(instruction.data),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type WritableAccount } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
export declare const PROPOSAL_EXECUTE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getProposalExecuteDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type ProposalExecuteInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountMultisig extends string | AccountMeta<string> = string, TAccountProposal extends string | AccountMeta<string> = string, TAccountTransaction extends string | AccountMeta<string> = string, TAccountMember extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
13
|
+
TAccountMultisig extends string ? ReadonlyAccount<TAccountMultisig> : TAccountMultisig,
|
|
14
|
+
TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
|
|
15
|
+
TAccountTransaction extends string ? ReadonlyAccount<TAccountTransaction> : TAccountTransaction,
|
|
16
|
+
TAccountMember extends string ? ReadonlySignerAccount<TAccountMember> & AccountSignerMeta<TAccountMember> : TAccountMember,
|
|
17
|
+
...TRemainingAccounts
|
|
18
|
+
]>;
|
|
19
|
+
export type ProposalExecuteInstructionData = {
|
|
20
|
+
discriminator: ReadonlyUint8Array;
|
|
21
|
+
};
|
|
22
|
+
export type ProposalExecuteInstructionDataArgs = {};
|
|
23
|
+
export declare function getProposalExecuteInstructionDataEncoder(): FixedSizeEncoder<ProposalExecuteInstructionDataArgs>;
|
|
24
|
+
export declare function getProposalExecuteInstructionDataDecoder(): FixedSizeDecoder<ProposalExecuteInstructionData>;
|
|
25
|
+
export declare function getProposalExecuteInstructionDataCodec(): FixedSizeCodec<ProposalExecuteInstructionDataArgs, ProposalExecuteInstructionData>;
|
|
26
|
+
export type ProposalExecuteInput<TAccountMultisig extends string = string, TAccountProposal extends string = string, TAccountTransaction extends string = string, TAccountMember extends string = string> = {
|
|
27
|
+
multisig: Address<TAccountMultisig>;
|
|
28
|
+
/** The proposal account associated with the transaction. */
|
|
29
|
+
proposal: Address<TAccountProposal>;
|
|
30
|
+
/** The transaction to execute. */
|
|
31
|
+
transaction: Address<TAccountTransaction>;
|
|
32
|
+
member: Address<TAccountMember>;
|
|
33
|
+
};
|
|
34
|
+
export declare function getProposalExecuteInstruction<TAccountMultisig extends string, TAccountProposal extends string, TAccountTransaction extends string, TAccountMember extends string, TProgramAddress extends Address = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS>(input: ProposalExecuteInput<TAccountMultisig, TAccountProposal, TAccountTransaction, TAccountMember>, config?: {
|
|
35
|
+
programAddress?: TProgramAddress;
|
|
36
|
+
}): ProposalExecuteInstruction<TProgramAddress, TAccountMultisig, TAccountProposal, TAccountTransaction, TAccountMember>;
|
|
37
|
+
export type ParsedProposalExecuteInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
38
|
+
programAddress: Address<TProgram>;
|
|
39
|
+
accounts: {
|
|
40
|
+
multisig: TAccountMetas[0];
|
|
41
|
+
/** The proposal account associated with the transaction. */
|
|
42
|
+
proposal: TAccountMetas[1];
|
|
43
|
+
/** The transaction to execute. */
|
|
44
|
+
transaction: TAccountMetas[2];
|
|
45
|
+
member: TAccountMetas[3];
|
|
46
|
+
};
|
|
47
|
+
data: ProposalExecuteInstructionData;
|
|
48
|
+
};
|
|
49
|
+
export declare function parseProposalExecuteInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedProposalExecuteInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,70 @@
|
|
|
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 { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { getAccountMetaFactory } from '../shared';
|
|
11
|
+
export const PROPOSAL_EXECUTE_DISCRIMINATOR = new Uint8Array([3]);
|
|
12
|
+
export function getProposalExecuteDiscriminatorBytes() {
|
|
13
|
+
return fixEncoderSize(getBytesEncoder(), 1).encode(PROPOSAL_EXECUTE_DISCRIMINATOR);
|
|
14
|
+
}
|
|
15
|
+
export function getProposalExecuteInstructionDataEncoder() {
|
|
16
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 1)]]), (value) => ({ ...value, discriminator: PROPOSAL_EXECUTE_DISCRIMINATOR }));
|
|
17
|
+
}
|
|
18
|
+
export function getProposalExecuteInstructionDataDecoder() {
|
|
19
|
+
return getStructDecoder([
|
|
20
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 1)],
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
export function getProposalExecuteInstructionDataCodec() {
|
|
24
|
+
return combineCodec(getProposalExecuteInstructionDataEncoder(), getProposalExecuteInstructionDataDecoder());
|
|
25
|
+
}
|
|
26
|
+
export function getProposalExecuteInstruction(input, config) {
|
|
27
|
+
// Program address.
|
|
28
|
+
const programAddress = config?.programAddress ?? FORTIS_MULTISIG_PROGRAM_ADDRESS;
|
|
29
|
+
// Original accounts.
|
|
30
|
+
const originalAccounts = {
|
|
31
|
+
multisig: { value: input.multisig ?? null, isWritable: false },
|
|
32
|
+
proposal: { value: input.proposal ?? null, isWritable: true },
|
|
33
|
+
transaction: { value: input.transaction ?? null, isWritable: false },
|
|
34
|
+
member: { value: input.member ?? null, isWritable: false },
|
|
35
|
+
};
|
|
36
|
+
const accounts = originalAccounts;
|
|
37
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
38
|
+
return Object.freeze({
|
|
39
|
+
accounts: [
|
|
40
|
+
getAccountMeta(accounts.multisig),
|
|
41
|
+
getAccountMeta(accounts.proposal),
|
|
42
|
+
getAccountMeta(accounts.transaction),
|
|
43
|
+
getAccountMeta(accounts.member),
|
|
44
|
+
],
|
|
45
|
+
data: getProposalExecuteInstructionDataEncoder().encode({}),
|
|
46
|
+
programAddress,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function parseProposalExecuteInstruction(instruction) {
|
|
50
|
+
if (instruction.accounts.length < 4) {
|
|
51
|
+
// TODO: Coded error.
|
|
52
|
+
throw new Error('Not enough accounts');
|
|
53
|
+
}
|
|
54
|
+
let accountIndex = 0;
|
|
55
|
+
const getNextAccount = () => {
|
|
56
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
57
|
+
accountIndex += 1;
|
|
58
|
+
return accountMeta;
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
programAddress: instruction.programAddress,
|
|
62
|
+
accounts: {
|
|
63
|
+
multisig: getNextAccount(),
|
|
64
|
+
proposal: getNextAccount(),
|
|
65
|
+
transaction: getNextAccount(),
|
|
66
|
+
member: getNextAccount(),
|
|
67
|
+
},
|
|
68
|
+
data: getProposalExecuteInstructionDataDecoder().decode(instruction.data),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 Address, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
+
import { type ParsedMultisigCreateInstruction, type ParsedProposalAccountsCloseInstruction, type ParsedProposalApproveInstruction, type ParsedProposalCreateInstruction, type ParsedProposalExecuteInstruction } from '../instructions';
|
|
10
|
+
export declare const FORTIS_MULTISIG_PROGRAM_ADDRESS: Address<"2Zwsw5UBArhtKwGV3mQpGMaaH4q8hVDwEyzVjMqTyvgi">;
|
|
11
|
+
export declare enum FortisMultisigAccount {
|
|
12
|
+
Multisig = 0,
|
|
13
|
+
Proposal = 1,
|
|
14
|
+
VaultTransaction = 2
|
|
15
|
+
}
|
|
16
|
+
export declare enum FortisMultisigInstruction {
|
|
17
|
+
MultisigCreate = 0,
|
|
18
|
+
ProposalCreate = 1,
|
|
19
|
+
ProposalExecute = 2,
|
|
20
|
+
ProposalApprove = 3,
|
|
21
|
+
ProposalAccountsClose = 4
|
|
22
|
+
}
|
|
23
|
+
export declare function identifyFortisMultisigInstruction(instruction: {
|
|
24
|
+
data: ReadonlyUint8Array;
|
|
25
|
+
} | ReadonlyUint8Array): FortisMultisigInstruction;
|
|
26
|
+
export type ParsedFortisMultisigInstruction<TProgram extends string = '2Zwsw5UBArhtKwGV3mQpGMaaH4q8hVDwEyzVjMqTyvgi'> = ({
|
|
27
|
+
instructionType: FortisMultisigInstruction.MultisigCreate;
|
|
28
|
+
} & ParsedMultisigCreateInstruction<TProgram>) | ({
|
|
29
|
+
instructionType: FortisMultisigInstruction.ProposalCreate;
|
|
30
|
+
} & ParsedProposalCreateInstruction<TProgram>) | ({
|
|
31
|
+
instructionType: FortisMultisigInstruction.ProposalExecute;
|
|
32
|
+
} & ParsedProposalExecuteInstruction<TProgram>) | ({
|
|
33
|
+
instructionType: FortisMultisigInstruction.ProposalApprove;
|
|
34
|
+
} & ParsedProposalApproveInstruction<TProgram>) | ({
|
|
35
|
+
instructionType: FortisMultisigInstruction.ProposalAccountsClose;
|
|
36
|
+
} & ParsedProposalAccountsCloseInstruction<TProgram>);
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { containsBytes, fixEncoderSize, getBytesEncoder, } from '@solana/kit';
|
|
9
|
+
export const FORTIS_MULTISIG_PROGRAM_ADDRESS = '2Zwsw5UBArhtKwGV3mQpGMaaH4q8hVDwEyzVjMqTyvgi';
|
|
10
|
+
export var FortisMultisigAccount;
|
|
11
|
+
(function (FortisMultisigAccount) {
|
|
12
|
+
FortisMultisigAccount[FortisMultisigAccount["Multisig"] = 0] = "Multisig";
|
|
13
|
+
FortisMultisigAccount[FortisMultisigAccount["Proposal"] = 1] = "Proposal";
|
|
14
|
+
FortisMultisigAccount[FortisMultisigAccount["VaultTransaction"] = 2] = "VaultTransaction";
|
|
15
|
+
})(FortisMultisigAccount || (FortisMultisigAccount = {}));
|
|
16
|
+
export var FortisMultisigInstruction;
|
|
17
|
+
(function (FortisMultisigInstruction) {
|
|
18
|
+
FortisMultisigInstruction[FortisMultisigInstruction["MultisigCreate"] = 0] = "MultisigCreate";
|
|
19
|
+
FortisMultisigInstruction[FortisMultisigInstruction["ProposalCreate"] = 1] = "ProposalCreate";
|
|
20
|
+
FortisMultisigInstruction[FortisMultisigInstruction["ProposalExecute"] = 2] = "ProposalExecute";
|
|
21
|
+
FortisMultisigInstruction[FortisMultisigInstruction["ProposalApprove"] = 3] = "ProposalApprove";
|
|
22
|
+
FortisMultisigInstruction[FortisMultisigInstruction["ProposalAccountsClose"] = 4] = "ProposalAccountsClose";
|
|
23
|
+
})(FortisMultisigInstruction || (FortisMultisigInstruction = {}));
|
|
24
|
+
export function identifyFortisMultisigInstruction(instruction) {
|
|
25
|
+
const data = 'data' in instruction ? instruction.data : instruction;
|
|
26
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 1).encode(new Uint8Array([0])), 0)) {
|
|
27
|
+
return FortisMultisigInstruction.MultisigCreate;
|
|
28
|
+
}
|
|
29
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 1).encode(new Uint8Array([1])), 0)) {
|
|
30
|
+
return FortisMultisigInstruction.ProposalCreate;
|
|
31
|
+
}
|
|
32
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 1).encode(new Uint8Array([2])), 0)) {
|
|
33
|
+
return FortisMultisigInstruction.ProposalExecute;
|
|
34
|
+
}
|
|
35
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 1).encode(new Uint8Array([3])), 0)) {
|
|
36
|
+
return FortisMultisigInstruction.ProposalApprove;
|
|
37
|
+
}
|
|
38
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 1).encode(new Uint8Array([4])), 0)) {
|
|
39
|
+
return FortisMultisigInstruction.ProposalAccountsClose;
|
|
40
|
+
}
|
|
41
|
+
throw new Error('The provided instruction could not be identified as a fortisMultisig instruction.');
|
|
42
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 ProgramDerivedAddress, type TransactionSigner } from '@solana/kit';
|
|
9
|
+
/**
|
|
10
|
+
* Asserts that the given value is not null or undefined.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function expectSome<T>(value: T | null | undefined): T;
|
|
14
|
+
/**
|
|
15
|
+
* Asserts that the given value is a PublicKey.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function expectAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): Address<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Asserts that the given value is a PDA.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function expectProgramDerivedAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): ProgramDerivedAddress<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Asserts that the given value is a TransactionSigner.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare function expectTransactionSigner<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): TransactionSigner<T>;
|
|
29
|
+
/**
|
|
30
|
+
* Defines an instruction account to resolve.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export type ResolvedAccount<T extends string = string, U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null = Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null> = {
|
|
34
|
+
isWritable: boolean;
|
|
35
|
+
value: U;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Defines an instruction that stores additional bytes on-chain.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export type InstructionWithByteDelta = {
|
|
42
|
+
byteDelta: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Get account metas and signers from resolved accounts.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => AccountMeta | AccountSignerMeta | undefined;
|
|
49
|
+
export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
|