forked from solana-labs/solana-program-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.flow.js
208 lines (207 loc) · 5.71 KB
/
module.flow.js
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/**
* Flow Library definition for spl-token
*
* This file is manually maintained
*
*/
declare module '@solana/spl-token' {
declare export var TOKEN_PROGRAM_ID;
declare export class u64 extends BN {
toBuffer(): Buffer;
static fromBuffer(buffer: Buffer): u64;
}
declare export type AuthorityType =
| 'MintTokens'
| 'FreezeAccount'
| 'AccountOwner'
| 'CloseAccount';
declare export var NATIVE_MINT: PublicKey;
declare export var MintLayout: Layout;
declare export type MintInfo = {|
mintAuthority: null | PublicKey,
supply: u64,
decimals: number,
isInitialized: boolean,
freezeAuthority: null | PublicKey,
|};
declare export var AccountLayout: Layout;
declare export type AccountInfo = {|
mint: PublicKey,
owner: PublicKey,
amount: u64,
delegate: null | PublicKey,
delegatedAmount: u64,
isInitialized: boolean,
isFrozen: boolean,
isNative: boolean,
rentExemptReserve: null | u64,
closeAuthority: null | PublicKey,
|};
declare export type MultisigInfo = {|
m: number,
n: number,
initialized: boolean,
signer1: PublicKey,
signer2: PublicKey,
signer3: PublicKey,
signer4: PublicKey,
signer5: PublicKey,
signer6: PublicKey,
signer7: PublicKey,
signer8: PublicKey,
signer9: PublicKey,
signer10: PublicKey,
signer11: PublicKey,
|};
declare export class Token {
publicKey: PublicKey;
programId: PublicKey;
payer: Account;
constructor(
connection: Connection,
publicKey: PublicKey,
programId: PublicKey,
payer: Account,
): Token;
static createMint(
connection: Connection,
payer: Account,
mintAuthority: PublicKey,
freezeAuthority: PublicKey | null,
decimals: number,
programId: PublicKey,
): Promise<Token>;
static getAccount(connection: Connection): Promise<Account>;
createAccount(owner: PublicKey): Promise<PublicKey>;
static createWrappedNativeAccount(
connection: Connection,
programId: PublicKey,
owner: PublicKey,
payer: Account,
amount: number,
): Promise<PublicKey>;
createMultisig(m: number, signers: Array<PublicKey>): Promise<PublicKey>;
getMintInfo(): Promise<MintInfo>;
getAccountInfo(account: PublicKey): Promise<AccountInfo>;
getMultisigInfo(multisig: PublicKey): Promise<MultisigInfo>;
transfer(
source: PublicKey,
destination: PublicKey,
owner: Account | PublicKey,
multiSigners: Array<Account>,
amount: number | u64,
): Promise<TransactionSignature>;
approve(
account: PublicKey,
delegate: PublicKey,
owner: Account | PublicKey,
multiSigners: Array<Account>,
amount: number | u64,
): Promise<void>;
revoke(
account: PublicKey,
owner: Account | PublicKey,
multiSigners: Array<Account>,
): Promise<void>;
setAuthority(
account: PublicKey,
newAuthority: PublicKey | null,
authorityType: AuthorityType,
currentAuthority: Account | PublicKey,
multiSigners: Array<Account>,
): Promise<void>;
mintTo(
dest: PublicKey,
authority: Account | PublicKey,
multiSigners: Array<Account>,
amount: number | u64,
): Promise<void>;
burn(
account: PublicKey,
owner: Account | PublicKey,
multiSigners: Array<Account>,
amount: number | u64,
): Promise<void>;
freezeAccount(
account: PublicKey,
authority: any,
multiSigners: Array<Account>,
): Promise<void>;
thawAccount(
account: PublicKey,
authority: any,
multiSigners: Array<Account>,
): Promise<void>;
closeAccount(
account: PublicKey,
dest: PublicKey,
authority: Account | PublicKey,
multiSigners: Array<Account>,
): Promise<void>;
static createInitMintInstruction(
programId: PublicKey,
mint: PublicKey,
decimals: number,
mintAuthority: PublicKey,
freezeAuthority: PublicKey | null,
): TransactionInstruction;
static createInitAccountInstruction(
programId: PublicKey,
mint: PublicKey,
account: PublicKey,
owner: PublicKey,
): TransactionInstruction;
static createTransferInstruction(
programId: PublicKey,
source: PublicKey,
destination: PublicKey,
owner: PublicKey,
multiSigners: Array<Account>,
amount: number | u64,
): TransactionInstruction;
static createApproveInstruction(
programId: PublicKey,
account: PublicKey,
delegate: PublicKey,
owner: PublicKey,
multiSigners: Array<Account>,
amount: number | u64,
): TransactionInstruction;
static createRevokeInstruction(
programId: PublicKey,
account: PublicKey,
owner: PublicKey,
multiSigners: Array<Account>,
): TransactionInstruction;
static createSetAuthorityInstruction(
programId: PublicKey,
account: PublicKey,
newAuthority: PublicKey | null,
authority: PublicKey,
multiSigners: Array<Account>,
): TransactionInstruction;
static createMintToInstruction(
programId: PublicKey,
mint: PublicKey,
dest: PublicKey,
authority: PublicKey,
multiSigners: Array<Account>,
amount: number | u64,
): TransactionInstruction;
static createBurnInstruction(
programId: PublicKey,
mint: PublicKey,
account: PublicKey,
owner: PublicKey,
multiSigners: Array<Account>,
amount: number | u64,
): TransactionInstruction;
static createCloseAccountInstruction(
programId: PublicKey,
account: PublicKey,
dest: PublicKey,
authority: PublicKey,
multiSigners: Array<Account>,
): TransactionInstruction;
}
}