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,10 @@
|
|
|
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
|
+
export * from './multisig';
|
|
9
|
+
export * from './proposal';
|
|
10
|
+
export * from './vaultTransaction';
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './multisig';
|
|
9
|
+
export * from './proposal';
|
|
10
|
+
export * from './vaultTransaction';
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount } from '@solana/kit';
|
|
9
|
+
export type Multisig = {
|
|
10
|
+
/** Key that is used to seed the multisig PDA. */
|
|
11
|
+
createKey: Address;
|
|
12
|
+
/**
|
|
13
|
+
* The address where the rent for the accounts related to executed, rejected, or cancelled
|
|
14
|
+
* transactions can be reclaimed. If set to `None`, the rent reclamation will be fortis treasury.
|
|
15
|
+
*/
|
|
16
|
+
rentCollector: Address;
|
|
17
|
+
/** Last transaction index. 0 means no transactions have been created. */
|
|
18
|
+
transactionIndex: bigint;
|
|
19
|
+
/** Threshold for signatures. */
|
|
20
|
+
threshold: number;
|
|
21
|
+
/** Bump for the multisig PDA seed. */
|
|
22
|
+
bump: number;
|
|
23
|
+
/** Members of the multisig. */
|
|
24
|
+
members: Array<Address>;
|
|
25
|
+
};
|
|
26
|
+
export type MultisigArgs = {
|
|
27
|
+
/** Key that is used to seed the multisig PDA. */
|
|
28
|
+
createKey: Address;
|
|
29
|
+
/**
|
|
30
|
+
* The address where the rent for the accounts related to executed, rejected, or cancelled
|
|
31
|
+
* transactions can be reclaimed. If set to `None`, the rent reclamation will be fortis treasury.
|
|
32
|
+
*/
|
|
33
|
+
rentCollector: Address;
|
|
34
|
+
/** Last transaction index. 0 means no transactions have been created. */
|
|
35
|
+
transactionIndex: number | bigint;
|
|
36
|
+
/** Threshold for signatures. */
|
|
37
|
+
threshold: number;
|
|
38
|
+
/** Bump for the multisig PDA seed. */
|
|
39
|
+
bump: number;
|
|
40
|
+
/** Members of the multisig. */
|
|
41
|
+
members: Array<Address>;
|
|
42
|
+
};
|
|
43
|
+
export declare function getMultisigEncoder(): Encoder<MultisigArgs>;
|
|
44
|
+
export declare function getMultisigDecoder(): Decoder<Multisig>;
|
|
45
|
+
export declare function getMultisigCodec(): Codec<MultisigArgs, Multisig>;
|
|
46
|
+
export declare function decodeMultisig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Multisig, TAddress>;
|
|
47
|
+
export declare function decodeMultisig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Multisig, TAddress>;
|
|
48
|
+
export declare function fetchMultisig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Multisig, TAddress>>;
|
|
49
|
+
export declare function fetchMaybeMultisig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Multisig, TAddress>>;
|
|
50
|
+
export declare function fetchAllMultisig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Multisig>[]>;
|
|
51
|
+
export declare function fetchAllMaybeMultisig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Multisig>[]>;
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, } from '@solana/kit';
|
|
9
|
+
export function getMultisigEncoder() {
|
|
10
|
+
return getStructEncoder([
|
|
11
|
+
['createKey', getAddressEncoder()],
|
|
12
|
+
['rentCollector', getAddressEncoder()],
|
|
13
|
+
['transactionIndex', getU64Encoder()],
|
|
14
|
+
['threshold', getU16Encoder()],
|
|
15
|
+
['bump', getU8Encoder()],
|
|
16
|
+
['members', getArrayEncoder(getAddressEncoder())],
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
export function getMultisigDecoder() {
|
|
20
|
+
return getStructDecoder([
|
|
21
|
+
['createKey', getAddressDecoder()],
|
|
22
|
+
['rentCollector', getAddressDecoder()],
|
|
23
|
+
['transactionIndex', getU64Decoder()],
|
|
24
|
+
['threshold', getU16Decoder()],
|
|
25
|
+
['bump', getU8Decoder()],
|
|
26
|
+
['members', getArrayDecoder(getAddressDecoder())],
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
export function getMultisigCodec() {
|
|
30
|
+
return combineCodec(getMultisigEncoder(), getMultisigDecoder());
|
|
31
|
+
}
|
|
32
|
+
export function decodeMultisig(encodedAccount) {
|
|
33
|
+
return decodeAccount(encodedAccount, getMultisigDecoder());
|
|
34
|
+
}
|
|
35
|
+
export async function fetchMultisig(rpc, address, config) {
|
|
36
|
+
const maybeAccount = await fetchMaybeMultisig(rpc, address, config);
|
|
37
|
+
assertAccountExists(maybeAccount);
|
|
38
|
+
return maybeAccount;
|
|
39
|
+
}
|
|
40
|
+
export async function fetchMaybeMultisig(rpc, address, config) {
|
|
41
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
42
|
+
return decodeMultisig(maybeAccount);
|
|
43
|
+
}
|
|
44
|
+
export async function fetchAllMultisig(rpc, addresses, config) {
|
|
45
|
+
const maybeAccounts = await fetchAllMaybeMultisig(rpc, addresses, config);
|
|
46
|
+
assertAccountsExist(maybeAccounts);
|
|
47
|
+
return maybeAccounts;
|
|
48
|
+
}
|
|
49
|
+
export async function fetchAllMaybeMultisig(rpc, addresses, config) {
|
|
50
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
51
|
+
return maybeAccounts.map((maybeAccount) => decodeMultisig(maybeAccount));
|
|
52
|
+
}
|
|
@@ -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 { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount } from '@solana/kit';
|
|
9
|
+
export type Proposal = {
|
|
10
|
+
/** The multisig this belongs to. */
|
|
11
|
+
multisig: Address;
|
|
12
|
+
/** Index of the multisig transaction this proposal is associated with. */
|
|
13
|
+
transactionIndex: bigint;
|
|
14
|
+
/** Last time when proposal status was changed. */
|
|
15
|
+
timeStamp: bigint;
|
|
16
|
+
/** Deadline to Vote. */
|
|
17
|
+
votingDeadline: bigint;
|
|
18
|
+
/** The status of the proposal Active,Approved,Executed. */
|
|
19
|
+
status: number;
|
|
20
|
+
/** PDA bump. */
|
|
21
|
+
bump: number;
|
|
22
|
+
/** Keys that have approved/signed. */
|
|
23
|
+
approved: Array<Address>;
|
|
24
|
+
};
|
|
25
|
+
export type ProposalArgs = {
|
|
26
|
+
/** The multisig this belongs to. */
|
|
27
|
+
multisig: Address;
|
|
28
|
+
/** Index of the multisig transaction this proposal is associated with. */
|
|
29
|
+
transactionIndex: number | bigint;
|
|
30
|
+
/** Last time when proposal status was changed. */
|
|
31
|
+
timeStamp: number | bigint;
|
|
32
|
+
/** Deadline to Vote. */
|
|
33
|
+
votingDeadline: number | bigint;
|
|
34
|
+
/** The status of the proposal Active,Approved,Executed. */
|
|
35
|
+
status: number;
|
|
36
|
+
/** PDA bump. */
|
|
37
|
+
bump: number;
|
|
38
|
+
/** Keys that have approved/signed. */
|
|
39
|
+
approved: Array<Address>;
|
|
40
|
+
};
|
|
41
|
+
export declare function getProposalEncoder(): Encoder<ProposalArgs>;
|
|
42
|
+
export declare function getProposalDecoder(): Decoder<Proposal>;
|
|
43
|
+
export declare function getProposalCodec(): Codec<ProposalArgs, Proposal>;
|
|
44
|
+
export declare function decodeProposal<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Proposal, TAddress>;
|
|
45
|
+
export declare function decodeProposal<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Proposal, TAddress>;
|
|
46
|
+
export declare function fetchProposal<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Proposal, TAddress>>;
|
|
47
|
+
export declare function fetchMaybeProposal<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Proposal, TAddress>>;
|
|
48
|
+
export declare function fetchAllProposal(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Proposal>[]>;
|
|
49
|
+
export declare function fetchAllMaybeProposal(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Proposal>[]>;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU8Decoder, getU8Encoder, } from '@solana/kit';
|
|
9
|
+
export function getProposalEncoder() {
|
|
10
|
+
return getStructEncoder([
|
|
11
|
+
['multisig', getAddressEncoder()],
|
|
12
|
+
['transactionIndex', getI64Encoder()],
|
|
13
|
+
['timeStamp', getI64Encoder()],
|
|
14
|
+
['votingDeadline', getI64Encoder()],
|
|
15
|
+
['status', getU8Encoder()],
|
|
16
|
+
['bump', getU8Encoder()],
|
|
17
|
+
['approved', getArrayEncoder(getAddressEncoder())],
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
export function getProposalDecoder() {
|
|
21
|
+
return getStructDecoder([
|
|
22
|
+
['multisig', getAddressDecoder()],
|
|
23
|
+
['transactionIndex', getI64Decoder()],
|
|
24
|
+
['timeStamp', getI64Decoder()],
|
|
25
|
+
['votingDeadline', getI64Decoder()],
|
|
26
|
+
['status', getU8Decoder()],
|
|
27
|
+
['bump', getU8Decoder()],
|
|
28
|
+
['approved', getArrayDecoder(getAddressDecoder())],
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
export function getProposalCodec() {
|
|
32
|
+
return combineCodec(getProposalEncoder(), getProposalDecoder());
|
|
33
|
+
}
|
|
34
|
+
export function decodeProposal(encodedAccount) {
|
|
35
|
+
return decodeAccount(encodedAccount, getProposalDecoder());
|
|
36
|
+
}
|
|
37
|
+
export async function fetchProposal(rpc, address, config) {
|
|
38
|
+
const maybeAccount = await fetchMaybeProposal(rpc, address, config);
|
|
39
|
+
assertAccountExists(maybeAccount);
|
|
40
|
+
return maybeAccount;
|
|
41
|
+
}
|
|
42
|
+
export async function fetchMaybeProposal(rpc, address, config) {
|
|
43
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
44
|
+
return decodeProposal(maybeAccount);
|
|
45
|
+
}
|
|
46
|
+
export async function fetchAllProposal(rpc, addresses, config) {
|
|
47
|
+
const maybeAccounts = await fetchAllMaybeProposal(rpc, addresses, config);
|
|
48
|
+
assertAccountsExist(maybeAccounts);
|
|
49
|
+
return maybeAccounts;
|
|
50
|
+
}
|
|
51
|
+
export async function fetchAllMaybeProposal(rpc, addresses, config) {
|
|
52
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
53
|
+
return maybeAccounts.map((maybeAccount) => decodeProposal(maybeAccount));
|
|
54
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
+
import { type VaultTransactionMessage, type VaultTransactionMessageArgs } from '../types';
|
|
10
|
+
export type VaultTransaction = {
|
|
11
|
+
/** The multisig this belongs to. */
|
|
12
|
+
multisig: Address;
|
|
13
|
+
/** Member of the Multisig who submitted the transaction. */
|
|
14
|
+
creator: Address;
|
|
15
|
+
/** Index of this transaction within the multisig. */
|
|
16
|
+
index: bigint;
|
|
17
|
+
/** bump for the transaction seeds. */
|
|
18
|
+
bump: number;
|
|
19
|
+
/** Derivation bump of the vault PDA this transaction belongs to. */
|
|
20
|
+
vaultBump: number;
|
|
21
|
+
/**
|
|
22
|
+
* Derivation bumps for additional signers.
|
|
23
|
+
* Some transactions require multiple signers. Often these additional signers are "ephemeral" keypairs
|
|
24
|
+
* that are generated on the client with a sole purpose of signing the transaction and be discarded immediately after.
|
|
25
|
+
* When wrapping such transactions into multisig ones, we replace these "ephemeral" signing keypairs
|
|
26
|
+
* with PDAs derived from the MultisigTransaction's `transaction_index` and controlled by the Multisig Program;
|
|
27
|
+
* during execution the program includes the seeds of these PDAs into the `invoke_signed` calls,
|
|
28
|
+
* thus "signing" on behalf of these PDAs.
|
|
29
|
+
*/
|
|
30
|
+
ephemeralSignerBumps: ReadonlyUint8Array;
|
|
31
|
+
/** data required for executing the transaction. */
|
|
32
|
+
message: VaultTransactionMessage;
|
|
33
|
+
};
|
|
34
|
+
export type VaultTransactionArgs = {
|
|
35
|
+
/** The multisig this belongs to. */
|
|
36
|
+
multisig: Address;
|
|
37
|
+
/** Member of the Multisig who submitted the transaction. */
|
|
38
|
+
creator: Address;
|
|
39
|
+
/** Index of this transaction within the multisig. */
|
|
40
|
+
index: number | bigint;
|
|
41
|
+
/** bump for the transaction seeds. */
|
|
42
|
+
bump: number;
|
|
43
|
+
/** Derivation bump of the vault PDA this transaction belongs to. */
|
|
44
|
+
vaultBump: number;
|
|
45
|
+
/**
|
|
46
|
+
* Derivation bumps for additional signers.
|
|
47
|
+
* Some transactions require multiple signers. Often these additional signers are "ephemeral" keypairs
|
|
48
|
+
* that are generated on the client with a sole purpose of signing the transaction and be discarded immediately after.
|
|
49
|
+
* When wrapping such transactions into multisig ones, we replace these "ephemeral" signing keypairs
|
|
50
|
+
* with PDAs derived from the MultisigTransaction's `transaction_index` and controlled by the Multisig Program;
|
|
51
|
+
* during execution the program includes the seeds of these PDAs into the `invoke_signed` calls,
|
|
52
|
+
* thus "signing" on behalf of these PDAs.
|
|
53
|
+
*/
|
|
54
|
+
ephemeralSignerBumps: ReadonlyUint8Array;
|
|
55
|
+
/** data required for executing the transaction. */
|
|
56
|
+
message: VaultTransactionMessageArgs;
|
|
57
|
+
};
|
|
58
|
+
export declare function getVaultTransactionEncoder(): Encoder<VaultTransactionArgs>;
|
|
59
|
+
export declare function getVaultTransactionDecoder(): Decoder<VaultTransaction>;
|
|
60
|
+
export declare function getVaultTransactionCodec(): Codec<VaultTransactionArgs, VaultTransaction>;
|
|
61
|
+
export declare function decodeVaultTransaction<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<VaultTransaction, TAddress>;
|
|
62
|
+
export declare function decodeVaultTransaction<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<VaultTransaction, TAddress>;
|
|
63
|
+
export declare function fetchVaultTransaction<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<VaultTransaction, TAddress>>;
|
|
64
|
+
export declare function fetchMaybeVaultTransaction<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<VaultTransaction, TAddress>>;
|
|
65
|
+
export declare function fetchAllVaultTransaction(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<VaultTransaction>[]>;
|
|
66
|
+
export declare function fetchAllMaybeVaultTransaction(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<VaultTransaction>[]>;
|
|
@@ -0,0 +1,61 @@
|
|
|
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 { addDecoderSizePrefix, addEncoderSizePrefix, assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, getAddressDecoder, getAddressEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, } from '@solana/kit';
|
|
9
|
+
import { getVaultTransactionMessageDecoder, getVaultTransactionMessageEncoder, } from '../types';
|
|
10
|
+
export function getVaultTransactionEncoder() {
|
|
11
|
+
return getStructEncoder([
|
|
12
|
+
['multisig', getAddressEncoder()],
|
|
13
|
+
['creator', getAddressEncoder()],
|
|
14
|
+
['index', getU64Encoder()],
|
|
15
|
+
['bump', getU8Encoder()],
|
|
16
|
+
['vaultBump', getU8Encoder()],
|
|
17
|
+
[
|
|
18
|
+
'ephemeralSignerBumps',
|
|
19
|
+
addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),
|
|
20
|
+
],
|
|
21
|
+
['message', getVaultTransactionMessageEncoder()],
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
export function getVaultTransactionDecoder() {
|
|
25
|
+
return getStructDecoder([
|
|
26
|
+
['multisig', getAddressDecoder()],
|
|
27
|
+
['creator', getAddressDecoder()],
|
|
28
|
+
['index', getU64Decoder()],
|
|
29
|
+
['bump', getU8Decoder()],
|
|
30
|
+
['vaultBump', getU8Decoder()],
|
|
31
|
+
[
|
|
32
|
+
'ephemeralSignerBumps',
|
|
33
|
+
addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),
|
|
34
|
+
],
|
|
35
|
+
['message', getVaultTransactionMessageDecoder()],
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
export function getVaultTransactionCodec() {
|
|
39
|
+
return combineCodec(getVaultTransactionEncoder(), getVaultTransactionDecoder());
|
|
40
|
+
}
|
|
41
|
+
export function decodeVaultTransaction(encodedAccount) {
|
|
42
|
+
return decodeAccount(encodedAccount, getVaultTransactionDecoder());
|
|
43
|
+
}
|
|
44
|
+
export async function fetchVaultTransaction(rpc, address, config) {
|
|
45
|
+
const maybeAccount = await fetchMaybeVaultTransaction(rpc, address, config);
|
|
46
|
+
assertAccountExists(maybeAccount);
|
|
47
|
+
return maybeAccount;
|
|
48
|
+
}
|
|
49
|
+
export async function fetchMaybeVaultTransaction(rpc, address, config) {
|
|
50
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
51
|
+
return decodeVaultTransaction(maybeAccount);
|
|
52
|
+
}
|
|
53
|
+
export async function fetchAllVaultTransaction(rpc, addresses, config) {
|
|
54
|
+
const maybeAccounts = await fetchAllMaybeVaultTransaction(rpc, addresses, config);
|
|
55
|
+
assertAccountsExist(maybeAccounts);
|
|
56
|
+
return maybeAccounts;
|
|
57
|
+
}
|
|
58
|
+
export async function fetchAllMaybeVaultTransaction(rpc, addresses, config) {
|
|
59
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
60
|
+
return maybeAccounts.map((maybeAccount) => decodeVaultTransaction(maybeAccount));
|
|
61
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export * from './accounts';
|
|
9
|
+
export * from './instructions';
|
|
10
|
+
export * from './programs';
|
|
11
|
+
export * from './types';
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export * from './accounts';
|
|
9
|
+
export * from './instructions';
|
|
10
|
+
export * from './programs';
|
|
11
|
+
export * from './types';
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export * from './multisigCreate';
|
|
9
|
+
export * from './proposalAccountsClose';
|
|
10
|
+
export * from './proposalApprove';
|
|
11
|
+
export * from './proposalCreate';
|
|
12
|
+
export * from './proposalExecute';
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export * from './multisigCreate';
|
|
9
|
+
export * from './proposalAccountsClose';
|
|
10
|
+
export * from './proposalApprove';
|
|
11
|
+
export * from './proposalCreate';
|
|
12
|
+
export * from './proposalExecute';
|
|
@@ -0,0 +1,65 @@
|
|
|
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, type WritableSignerAccount } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { type MultisigCreateArgs, type MultisigCreateArgsArgs } from '../types';
|
|
11
|
+
export declare const MULTISIG_CREATE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
12
|
+
export declare function getMultisigCreateDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
+
export type MultisigCreateInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountTreasury extends string | AccountMeta<string> = string, TAccountMultisig extends string | AccountMeta<string> = string, TAccountCreateKey extends string | AccountMeta<string> = string, TAccountCreator extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
14
|
+
TAccountTreasury extends string ? WritableAccount<TAccountTreasury> : TAccountTreasury,
|
|
15
|
+
TAccountMultisig extends string ? WritableAccount<TAccountMultisig> : TAccountMultisig,
|
|
16
|
+
TAccountCreateKey extends string ? ReadonlySignerAccount<TAccountCreateKey> & AccountSignerMeta<TAccountCreateKey> : TAccountCreateKey,
|
|
17
|
+
TAccountCreator extends string ? WritableSignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator,
|
|
18
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
19
|
+
...TRemainingAccounts
|
|
20
|
+
]>;
|
|
21
|
+
export type MultisigCreateInstructionData = {
|
|
22
|
+
discriminator: ReadonlyUint8Array;
|
|
23
|
+
args: MultisigCreateArgs;
|
|
24
|
+
};
|
|
25
|
+
export type MultisigCreateInstructionDataArgs = {
|
|
26
|
+
args: MultisigCreateArgsArgs;
|
|
27
|
+
};
|
|
28
|
+
export declare function getMultisigCreateInstructionDataEncoder(): Encoder<MultisigCreateInstructionDataArgs>;
|
|
29
|
+
export declare function getMultisigCreateInstructionDataDecoder(): Decoder<MultisigCreateInstructionData>;
|
|
30
|
+
export declare function getMultisigCreateInstructionDataCodec(): Codec<MultisigCreateInstructionDataArgs, MultisigCreateInstructionData>;
|
|
31
|
+
export type MultisigCreateInput<TAccountTreasury extends string = string, TAccountMultisig extends string = string, TAccountCreateKey extends string = string, TAccountCreator extends string = string, TAccountSystemProgram extends string = string> = {
|
|
32
|
+
/** The treasury where the creation fee is transferred to. */
|
|
33
|
+
treasury: Address<TAccountTreasury>;
|
|
34
|
+
multisig: Address<TAccountMultisig>;
|
|
35
|
+
/**
|
|
36
|
+
* An ephemeral signer that is used as a seed for the Multisig PDA.
|
|
37
|
+
* Must be a signer to prevent front-running attack by someone else but the original creator.
|
|
38
|
+
*/
|
|
39
|
+
createKey: Address<TAccountCreateKey>;
|
|
40
|
+
/** The creator of the multisig. */
|
|
41
|
+
creator: Address<TAccountCreator>;
|
|
42
|
+
systemProgram: Address<TAccountSystemProgram>;
|
|
43
|
+
args: MultisigCreateInstructionDataArgs['args'];
|
|
44
|
+
};
|
|
45
|
+
export declare function getMultisigCreateInstruction<TAccountTreasury extends string, TAccountMultisig extends string, TAccountCreateKey extends string, TAccountCreator extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS>(input: MultisigCreateInput<TAccountTreasury, TAccountMultisig, TAccountCreateKey, TAccountCreator, TAccountSystemProgram>, config?: {
|
|
46
|
+
programAddress?: TProgramAddress;
|
|
47
|
+
}): MultisigCreateInstruction<TProgramAddress, TAccountTreasury, TAccountMultisig, TAccountCreateKey, TAccountCreator, TAccountSystemProgram>;
|
|
48
|
+
export type ParsedMultisigCreateInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
49
|
+
programAddress: Address<TProgram>;
|
|
50
|
+
accounts: {
|
|
51
|
+
/** The treasury where the creation fee is transferred to. */
|
|
52
|
+
treasury: TAccountMetas[0];
|
|
53
|
+
multisig: TAccountMetas[1];
|
|
54
|
+
/**
|
|
55
|
+
* An ephemeral signer that is used as a seed for the Multisig PDA.
|
|
56
|
+
* Must be a signer to prevent front-running attack by someone else but the original creator.
|
|
57
|
+
*/
|
|
58
|
+
createKey: TAccountMetas[2];
|
|
59
|
+
/** The creator of the multisig. */
|
|
60
|
+
creator: TAccountMetas[3];
|
|
61
|
+
systemProgram: TAccountMetas[4];
|
|
62
|
+
};
|
|
63
|
+
data: MultisigCreateInstructionData;
|
|
64
|
+
};
|
|
65
|
+
export declare function parseMultisigCreateInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedMultisigCreateInstruction<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 { getMultisigCreateArgsDecoder, getMultisigCreateArgsEncoder, } from '../types';
|
|
12
|
+
export const MULTISIG_CREATE_DISCRIMINATOR = new Uint8Array([0]);
|
|
13
|
+
export function getMultisigCreateDiscriminatorBytes() {
|
|
14
|
+
return fixEncoderSize(getBytesEncoder(), 1).encode(MULTISIG_CREATE_DISCRIMINATOR);
|
|
15
|
+
}
|
|
16
|
+
export function getMultisigCreateInstructionDataEncoder() {
|
|
17
|
+
return transformEncoder(getStructEncoder([
|
|
18
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 1)],
|
|
19
|
+
['args', getMultisigCreateArgsEncoder()],
|
|
20
|
+
]), (value) => ({ ...value, discriminator: MULTISIG_CREATE_DISCRIMINATOR }));
|
|
21
|
+
}
|
|
22
|
+
export function getMultisigCreateInstructionDataDecoder() {
|
|
23
|
+
return getStructDecoder([
|
|
24
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 1)],
|
|
25
|
+
['args', getMultisigCreateArgsDecoder()],
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
export function getMultisigCreateInstructionDataCodec() {
|
|
29
|
+
return combineCodec(getMultisigCreateInstructionDataEncoder(), getMultisigCreateInstructionDataDecoder());
|
|
30
|
+
}
|
|
31
|
+
export function getMultisigCreateInstruction(input, config) {
|
|
32
|
+
// Program address.
|
|
33
|
+
const programAddress = config?.programAddress ?? FORTIS_MULTISIG_PROGRAM_ADDRESS;
|
|
34
|
+
// Original accounts.
|
|
35
|
+
const originalAccounts = {
|
|
36
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
37
|
+
multisig: { value: input.multisig ?? null, isWritable: true },
|
|
38
|
+
createKey: { value: input.createKey ?? null, isWritable: false },
|
|
39
|
+
creator: { value: input.creator ?? 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.treasury),
|
|
49
|
+
getAccountMeta(accounts.multisig),
|
|
50
|
+
getAccountMeta(accounts.createKey),
|
|
51
|
+
getAccountMeta(accounts.creator),
|
|
52
|
+
getAccountMeta(accounts.systemProgram),
|
|
53
|
+
],
|
|
54
|
+
data: getMultisigCreateInstructionDataEncoder().encode(args),
|
|
55
|
+
programAddress,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export function parseMultisigCreateInstruction(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
|
+
treasury: getNextAccount(),
|
|
73
|
+
multisig: getNextAccount(),
|
|
74
|
+
createKey: getNextAccount(),
|
|
75
|
+
creator: getNextAccount(),
|
|
76
|
+
systemProgram: getNextAccount(),
|
|
77
|
+
},
|
|
78
|
+
data: getMultisigCreateInstructionDataDecoder().decode(instruction.data),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount } from '@solana/kit';
|
|
9
|
+
import { FORTIS_MULTISIG_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
export declare const PROPOSAL_ACCOUNTS_CLOSE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getProposalAccountsCloseDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type ProposalAccountsCloseInstruction<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, TAccountRentCollector extends string | AccountMeta<string> = string, TAccountSystemProgram 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 ? WritableAccount<TAccountTransaction> : TAccountTransaction,
|
|
16
|
+
TAccountRentCollector extends string ? WritableAccount<TAccountRentCollector> : TAccountRentCollector,
|
|
17
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
18
|
+
...TRemainingAccounts
|
|
19
|
+
]>;
|
|
20
|
+
export type ProposalAccountsCloseInstructionData = {
|
|
21
|
+
discriminator: ReadonlyUint8Array;
|
|
22
|
+
};
|
|
23
|
+
export type ProposalAccountsCloseInstructionDataArgs = {};
|
|
24
|
+
export declare function getProposalAccountsCloseInstructionDataEncoder(): FixedSizeEncoder<ProposalAccountsCloseInstructionDataArgs>;
|
|
25
|
+
export declare function getProposalAccountsCloseInstructionDataDecoder(): FixedSizeDecoder<ProposalAccountsCloseInstructionData>;
|
|
26
|
+
export declare function getProposalAccountsCloseInstructionDataCodec(): FixedSizeCodec<ProposalAccountsCloseInstructionDataArgs, ProposalAccountsCloseInstructionData>;
|
|
27
|
+
export type ProposalAccountsCloseInput<TAccountMultisig extends string = string, TAccountProposal extends string = string, TAccountTransaction extends string = string, TAccountRentCollector extends string = string, TAccountSystemProgram extends string = string> = {
|
|
28
|
+
multisig: Address<TAccountMultisig>;
|
|
29
|
+
/** the logic within `vault_transaction_accounts_close` does the rest of the checks. */
|
|
30
|
+
proposal: Address<TAccountProposal>;
|
|
31
|
+
/** VaultTransaction corresponding to the `proposal`. */
|
|
32
|
+
transaction: Address<TAccountTransaction>;
|
|
33
|
+
/** The rent collector. */
|
|
34
|
+
rentCollector: Address<TAccountRentCollector>;
|
|
35
|
+
systemProgram: Address<TAccountSystemProgram>;
|
|
36
|
+
};
|
|
37
|
+
export declare function getProposalAccountsCloseInstruction<TAccountMultisig extends string, TAccountProposal extends string, TAccountTransaction extends string, TAccountRentCollector extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS>(input: ProposalAccountsCloseInput<TAccountMultisig, TAccountProposal, TAccountTransaction, TAccountRentCollector, TAccountSystemProgram>, config?: {
|
|
38
|
+
programAddress?: TProgramAddress;
|
|
39
|
+
}): ProposalAccountsCloseInstruction<TProgramAddress, TAccountMultisig, TAccountProposal, TAccountTransaction, TAccountRentCollector, TAccountSystemProgram>;
|
|
40
|
+
export type ParsedProposalAccountsCloseInstruction<TProgram extends string = typeof FORTIS_MULTISIG_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
41
|
+
programAddress: Address<TProgram>;
|
|
42
|
+
accounts: {
|
|
43
|
+
multisig: TAccountMetas[0];
|
|
44
|
+
/** the logic within `vault_transaction_accounts_close` does the rest of the checks. */
|
|
45
|
+
proposal: TAccountMetas[1];
|
|
46
|
+
/** VaultTransaction corresponding to the `proposal`. */
|
|
47
|
+
transaction: TAccountMetas[2];
|
|
48
|
+
/** The rent collector. */
|
|
49
|
+
rentCollector: TAccountMetas[3];
|
|
50
|
+
systemProgram: TAccountMetas[4];
|
|
51
|
+
};
|
|
52
|
+
data: ProposalAccountsCloseInstructionData;
|
|
53
|
+
};
|
|
54
|
+
export declare function parseProposalAccountsCloseInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedProposalAccountsCloseInstruction<TProgram, TAccountMetas>;
|