-
Notifications
You must be signed in to change notification settings - Fork 522
Expand file tree
/
Copy pathprocessSetSaturation.ts
More file actions
104 lines (98 loc) · 2.65 KB
/
processSetSaturation.ts
File metadata and controls
104 lines (98 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
* This code was GENERATED using the solita package.
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
*
* See: https://github.com/metaplex-foundation/solita
*/
import * as beet from '@metaplex-foundation/beet';
import * as web3 from '@solana/web3.js';
/**
* @category Instructions
* @category ProcessSetSaturation
* @category generated
*/
export type ProcessSetSaturationInstructionArgs = {
saturationLimit: beet.bignum;
};
/**
* @category Instructions
* @category ProcessSetSaturation
* @category generated
*/
export const processSetSaturationStruct = new beet.BeetArgsStruct<
ProcessSetSaturationInstructionArgs & {
instructionDiscriminator: number[] /* size: 8 */;
}
>(
[
['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
['saturationLimit', beet.u64],
],
'ProcessSetSaturationInstructionArgs',
);
/**
* Accounts required by the _processSetSaturation_ instruction
*
* @property [**signer**] authority
* @property [] member
* @property [_writable_] fanout
* @property [_writable_] membershipAccount
* @category Instructions
* @category ProcessSetSaturation
* @category generated
*/
export type ProcessSetSaturationInstructionAccounts = {
authority: web3.PublicKey;
member: web3.PublicKey;
fanout: web3.PublicKey;
membershipAccount: web3.PublicKey;
};
export const processSetSaturationInstructionDiscriminator = [36, 113, 187, 145, 92, 204, 116, 202];
/**
* Creates a _ProcessSetSaturation_ instruction.
*
* @param accounts that will be accessed while the instruction is processed
* @param args to provide as instruction data to the program
*
* @category Instructions
* @category ProcessSetSaturation
* @category generated
*/
export function createProcessSetSaturationInstruction(
accounts: ProcessSetSaturationInstructionAccounts,
args: ProcessSetSaturationInstructionArgs,
) {
const { authority, member, fanout, membershipAccount } = accounts;
const [data] = processSetSaturationStruct.serialize({
instructionDiscriminator: processSetSaturationInstructionDiscriminator,
...args,
});
const keys: web3.AccountMeta[] = [
{
pubkey: authority,
isWritable: false,
isSigner: true,
},
{
pubkey: member,
isWritable: false,
isSigner: false,
},
{
pubkey: fanout,
isWritable: true,
isSigner: false,
},
{
pubkey: membershipAccount,
isWritable: true,
isSigner: false,
},
];
const ix = new web3.TransactionInstruction({
programId: new web3.PublicKey('hyDQ4Nz1eYyegS6JfenyKwKzYxRsCWCriYSAjtzP4Vg'),
keys,
data,
});
return ix;
}