@lightprotocol/compressed-token 0.17.2-alpha.0 → 0.17.2-alpha.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.
@@ -1,6 +1,8 @@
1
1
  import { PackedMerkleContext, CompressedProof, ParsedTokenAccount, InputTokenDataWithContext as InputTokenDataWithContext$1, Rpc } from '@lightprotocol/stateless.js';
2
2
  import { PublicKey, AccountMeta, TransactionInstruction, Connection, Signer, ConfirmOptions, TransactionSignature, Keypair } from '@solana/web3.js';
3
3
  import BN from 'bn.js';
4
+ import * as buffer_layout from 'buffer-layout';
5
+ import { Buffer as Buffer$1 } from 'buffer';
4
6
 
5
7
  type CompressedCpiContext = {
6
8
  setContext: boolean;
@@ -59,6 +61,16 @@ type DelegatedTransfer = {
59
61
  owner: PublicKey;
60
62
  delegateChangeAccountIndex: number | null;
61
63
  };
64
+ type MintToInstructionData = {
65
+ recipients: PublicKey[];
66
+ amounts: BN[];
67
+ lamports: BN | null;
68
+ };
69
+ type CompressSplTokenAccountInstructionData = {
70
+ owner: PublicKey;
71
+ remainingAmount: BN | null;
72
+ cpiContext: CompressedCpiContext | null;
73
+ };
62
74
  type CompressedTokenInstructionDataTransfer = {
63
75
  /**
64
76
  * Validity proof
@@ -157,6 +169,10 @@ declare function packCompressedTokenAccounts(params: PackCompressedTokenAccounts
157
169
  declare const POOL_SEED: Buffer;
158
170
  declare const CPI_AUTHORITY_SEED: Buffer;
159
171
  declare const SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE = 1461600;
172
+ declare const CREATE_TOKEN_POOL_DISCRIMINATOR: Buffer;
173
+ declare const MINT_TO_DISCRIMINATOR: Buffer;
174
+ declare const TRANSFER_DISCRIMINATOR: Buffer;
175
+ declare const COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer;
160
176
 
161
177
  type CompressParams = {
162
178
  /**
@@ -759,4 +775,1797 @@ declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authorit
759
775
  */
760
776
  declare function compressSplTokenAccount(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, tokenAccount: PublicKey, outputStateTree: PublicKey, remainingAmount?: BN, confirmOptions?: ConfirmOptions, tokenProgramId?: PublicKey): Promise<TransactionSignature>;
761
777
 
762
- export { type ApproveAndMintToParams, CPI_AUTHORITY_SEED, type CompressParams, type CompressSplTokenAccountParams, type CompressedCpiContext, type CompressedTokenInstructionDataTransfer, CompressedTokenProgram, type CreateMintParams, type CreateTokenProgramLookupTableParams, type DecompressParams, type DelegatedTransfer, type InputTokenDataWithContext, type MergeTokenAccountsParams, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type TokenData, type TokenTransferOutputData, type TransferParams, approveAndMintTo, compress, compressSplTokenAccount, createDecompressOutputState, createMint, createTokenPool, createTokenProgramLookupTable, createTransferOutputState, decompress, mergeTokenAccounts, mintTo, packCompressedTokenAccounts, parseTokenData, selectMinCompressedTokenAccountsForTransfer, sumUpTokenAmount, transfer, validateSameTokenOwner };
778
+ declare const DelegatedTransferLayout: buffer_layout.Layout<unknown>;
779
+ declare const CpiContextLayout: buffer_layout.Layout<unknown>;
780
+ declare const CompressedTokenInstructionDataTransferLayout: buffer_layout.Layout<unknown>;
781
+ declare const mintToLayout: buffer_layout.Layout<unknown>;
782
+ declare const compressSplTokenAccountInstructionDataLayout: buffer_layout.Layout<unknown>;
783
+ declare function encodeMintToInstructionData(data: MintToInstructionData): Buffer$1;
784
+ declare function decodeMintToInstructionData(buffer: Buffer$1): MintToInstructionData;
785
+ declare function encodeCompressSplTokenAccountInstructionData(data: CompressSplTokenAccountInstructionData): Buffer$1;
786
+ declare function decodeCompressSplTokenAccountInstructionData(buffer: Buffer$1): CompressSplTokenAccountInstructionData;
787
+ declare function encodeTransferInstructionData(data: CompressedTokenInstructionDataTransfer): Buffer$1;
788
+ declare function decodeTransferInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataTransfer;
789
+ interface BaseAccountsLayoutParams {
790
+ feePayer: PublicKey;
791
+ authority: PublicKey;
792
+ cpiAuthorityPda: PublicKey;
793
+ lightSystemProgram: PublicKey;
794
+ registeredProgramPda: PublicKey;
795
+ noopProgram: PublicKey;
796
+ accountCompressionAuthority: PublicKey;
797
+ accountCompressionProgram: PublicKey;
798
+ selfProgram: PublicKey;
799
+ systemProgram: PublicKey;
800
+ }
801
+ type createTokenPoolAccountsLayoutParams = {
802
+ feePayer: PublicKey;
803
+ tokenPoolPda: PublicKey;
804
+ systemProgram: PublicKey;
805
+ mint: PublicKey;
806
+ tokenProgram: PublicKey;
807
+ cpiAuthorityPda: PublicKey;
808
+ };
809
+ type mintToAccountsLayoutParams = BaseAccountsLayoutParams & {
810
+ mint: PublicKey;
811
+ tokenPoolPda: PublicKey;
812
+ tokenProgram: PublicKey;
813
+ merkleTree: PublicKey;
814
+ solPoolPda: PublicKey | null;
815
+ };
816
+ type transferAccountsLayoutParams = BaseAccountsLayoutParams & {
817
+ tokenPoolPda?: PublicKey;
818
+ compressOrDecompressTokenAccount?: PublicKey;
819
+ tokenProgram?: PublicKey;
820
+ };
821
+ type approveAccountsLayoutParams = BaseAccountsLayoutParams;
822
+ type revokeAccountsLayoutParams = approveAccountsLayoutParams;
823
+ type freezeAccountsLayoutParams = BaseAccountsLayoutParams & {
824
+ mint: PublicKey;
825
+ };
826
+ type thawAccountsLayoutParams = freezeAccountsLayoutParams;
827
+ declare const createTokenPoolAccountsLayout: (accounts: createTokenPoolAccountsLayoutParams) => AccountMeta[];
828
+ declare const mintToAccountsLayout: (accounts: mintToAccountsLayoutParams) => AccountMeta[];
829
+ declare const transferAccountsLayout: (accounts: transferAccountsLayoutParams) => AccountMeta[];
830
+
831
+ type LightCompressedToken = {
832
+ version: '1.2.0';
833
+ name: 'light_compressed_token';
834
+ instructions: [
835
+ {
836
+ name: 'createTokenPool';
837
+ docs: [
838
+ 'This instruction creates a token pool for a given mint. Every spl mint',
839
+ 'can have one token pool. When a token is compressed the tokens are',
840
+ 'transferrred to the token pool, and their compressed equivalent is',
841
+ 'minted into a Merkle tree.'
842
+ ];
843
+ accounts: [
844
+ {
845
+ name: 'feePayer';
846
+ isMut: true;
847
+ isSigner: true;
848
+ docs: ['UNCHECKED: only pays fees.'];
849
+ },
850
+ {
851
+ name: 'tokenPoolPda';
852
+ isMut: true;
853
+ isSigner: false;
854
+ },
855
+ {
856
+ name: 'systemProgram';
857
+ isMut: false;
858
+ isSigner: false;
859
+ },
860
+ {
861
+ name: 'mint';
862
+ isMut: true;
863
+ isSigner: false;
864
+ },
865
+ {
866
+ name: 'tokenProgram';
867
+ isMut: false;
868
+ isSigner: false;
869
+ },
870
+ {
871
+ name: 'cpiAuthorityPda';
872
+ isMut: false;
873
+ isSigner: false;
874
+ }
875
+ ];
876
+ args: [];
877
+ },
878
+ {
879
+ name: 'addTokenPool';
880
+ docs: [
881
+ 'This instruction creates an additional token pool for a given mint.',
882
+ 'The maximum number of token pools per mint is 5.'
883
+ ];
884
+ accounts: [
885
+ {
886
+ name: 'feePayer';
887
+ isMut: true;
888
+ isSigner: true;
889
+ docs: ['UNCHECKED: only pays fees.'];
890
+ },
891
+ {
892
+ name: 'tokenPoolPda';
893
+ isMut: true;
894
+ isSigner: false;
895
+ },
896
+ {
897
+ name: 'existingTokenPoolPda';
898
+ isMut: false;
899
+ isSigner: false;
900
+ },
901
+ {
902
+ name: 'systemProgram';
903
+ isMut: false;
904
+ isSigner: false;
905
+ },
906
+ {
907
+ name: 'mint';
908
+ isMut: true;
909
+ isSigner: false;
910
+ },
911
+ {
912
+ name: 'tokenProgram';
913
+ isMut: false;
914
+ isSigner: false;
915
+ },
916
+ {
917
+ name: 'cpiAuthorityPda';
918
+ isMut: false;
919
+ isSigner: false;
920
+ }
921
+ ];
922
+ args: [
923
+ {
924
+ name: 'tokenPoolBump';
925
+ type: 'u8';
926
+ }
927
+ ];
928
+ },
929
+ {
930
+ name: 'mintTo';
931
+ docs: [
932
+ 'Mints tokens from an spl token mint to a list of compressed accounts.',
933
+ 'Minted tokens are transferred to a pool account owned by the compressed',
934
+ 'token program. The instruction creates one compressed output account for',
935
+ 'every amount and pubkey input pair. A constant amount of lamports can be',
936
+ 'transferred to each output account to enable. A use case to add lamports',
937
+ 'to a compressed token account is to prevent spam. This is the only way',
938
+ 'to add lamports to a compressed token account.'
939
+ ];
940
+ accounts: [
941
+ {
942
+ name: 'feePayer';
943
+ isMut: true;
944
+ isSigner: true;
945
+ docs: ['UNCHECKED: only pays fees.'];
946
+ },
947
+ {
948
+ name: 'authority';
949
+ isMut: false;
950
+ isSigner: true;
951
+ },
952
+ {
953
+ name: 'cpiAuthorityPda';
954
+ isMut: false;
955
+ isSigner: false;
956
+ },
957
+ {
958
+ name: 'mint';
959
+ isMut: true;
960
+ isSigner: false;
961
+ },
962
+ {
963
+ name: 'tokenPoolPda';
964
+ isMut: true;
965
+ isSigner: false;
966
+ },
967
+ {
968
+ name: 'tokenProgram';
969
+ isMut: false;
970
+ isSigner: false;
971
+ },
972
+ {
973
+ name: 'lightSystemProgram';
974
+ isMut: false;
975
+ isSigner: false;
976
+ },
977
+ {
978
+ name: 'registeredProgramPda';
979
+ isMut: false;
980
+ isSigner: false;
981
+ },
982
+ {
983
+ name: 'noopProgram';
984
+ isMut: false;
985
+ isSigner: false;
986
+ docs: ['programs'];
987
+ },
988
+ {
989
+ name: 'accountCompressionAuthority';
990
+ isMut: false;
991
+ isSigner: false;
992
+ },
993
+ {
994
+ name: 'accountCompressionProgram';
995
+ isMut: false;
996
+ isSigner: false;
997
+ },
998
+ {
999
+ name: 'merkleTree';
1000
+ isMut: true;
1001
+ isSigner: false;
1002
+ },
1003
+ {
1004
+ name: 'selfProgram';
1005
+ isMut: false;
1006
+ isSigner: false;
1007
+ },
1008
+ {
1009
+ name: 'systemProgram';
1010
+ isMut: false;
1011
+ isSigner: false;
1012
+ },
1013
+ {
1014
+ name: 'solPoolPda';
1015
+ isMut: true;
1016
+ isSigner: false;
1017
+ isOptional: true;
1018
+ }
1019
+ ];
1020
+ args: [
1021
+ {
1022
+ name: 'publicKeys';
1023
+ type: {
1024
+ vec: 'publicKey';
1025
+ };
1026
+ },
1027
+ {
1028
+ name: 'amounts';
1029
+ type: {
1030
+ vec: 'u64';
1031
+ };
1032
+ },
1033
+ {
1034
+ name: 'lamports';
1035
+ type: {
1036
+ option: 'u64';
1037
+ };
1038
+ }
1039
+ ];
1040
+ },
1041
+ {
1042
+ name: 'compressSplTokenAccount';
1043
+ docs: [
1044
+ 'Compresses the balance of an spl token account sub an optional remaining',
1045
+ 'amount. This instruction does not close the spl token account. To close',
1046
+ 'the account bundle a close spl account instruction in your transaction.'
1047
+ ];
1048
+ accounts: [
1049
+ {
1050
+ name: 'feePayer';
1051
+ isMut: true;
1052
+ isSigner: true;
1053
+ docs: ['UNCHECKED: only pays fees.'];
1054
+ },
1055
+ {
1056
+ name: 'authority';
1057
+ isMut: false;
1058
+ isSigner: true;
1059
+ docs: [
1060
+ 'Authority is verified through proof since both owner and delegate',
1061
+ 'are included in the token data hash, which is a public input to the',
1062
+ 'validity proof.'
1063
+ ];
1064
+ },
1065
+ {
1066
+ name: 'cpiAuthorityPda';
1067
+ isMut: false;
1068
+ isSigner: false;
1069
+ },
1070
+ {
1071
+ name: 'lightSystemProgram';
1072
+ isMut: false;
1073
+ isSigner: false;
1074
+ },
1075
+ {
1076
+ name: 'registeredProgramPda';
1077
+ isMut: false;
1078
+ isSigner: false;
1079
+ },
1080
+ {
1081
+ name: 'noopProgram';
1082
+ isMut: false;
1083
+ isSigner: false;
1084
+ },
1085
+ {
1086
+ name: 'accountCompressionAuthority';
1087
+ isMut: false;
1088
+ isSigner: false;
1089
+ },
1090
+ {
1091
+ name: 'accountCompressionProgram';
1092
+ isMut: false;
1093
+ isSigner: false;
1094
+ },
1095
+ {
1096
+ name: 'selfProgram';
1097
+ isMut: false;
1098
+ isSigner: false;
1099
+ docs: ['this program is the signer of the cpi.'];
1100
+ },
1101
+ {
1102
+ name: 'tokenPoolPda';
1103
+ isMut: true;
1104
+ isSigner: false;
1105
+ isOptional: true;
1106
+ },
1107
+ {
1108
+ name: 'compressOrDecompressTokenAccount';
1109
+ isMut: true;
1110
+ isSigner: false;
1111
+ isOptional: true;
1112
+ },
1113
+ {
1114
+ name: 'tokenProgram';
1115
+ isMut: false;
1116
+ isSigner: false;
1117
+ isOptional: true;
1118
+ },
1119
+ {
1120
+ name: 'systemProgram';
1121
+ isMut: false;
1122
+ isSigner: false;
1123
+ }
1124
+ ];
1125
+ args: [
1126
+ {
1127
+ name: 'owner';
1128
+ type: 'publicKey';
1129
+ },
1130
+ {
1131
+ name: 'remainingAmount';
1132
+ type: {
1133
+ option: 'u64';
1134
+ };
1135
+ },
1136
+ {
1137
+ name: 'cpiContext';
1138
+ type: {
1139
+ option: {
1140
+ defined: 'CompressedCpiContext';
1141
+ };
1142
+ };
1143
+ }
1144
+ ];
1145
+ },
1146
+ {
1147
+ name: 'transfer';
1148
+ docs: [
1149
+ 'Transfers compressed tokens from one account to another. All accounts',
1150
+ 'must be of the same mint. Additional spl tokens can be compressed or',
1151
+ 'decompressed. In one transaction only compression or decompression is',
1152
+ 'possible. Lamports can be transferred alongside tokens. If output token',
1153
+ 'accounts specify less lamports than inputs the remaining lamports are',
1154
+ 'transferred to an output compressed account. Signer must be owner or',
1155
+ 'delegate. If a delegated token account is transferred the delegate is',
1156
+ 'not preserved.'
1157
+ ];
1158
+ accounts: [
1159
+ {
1160
+ name: 'feePayer';
1161
+ isMut: true;
1162
+ isSigner: true;
1163
+ docs: ['UNCHECKED: only pays fees.'];
1164
+ },
1165
+ {
1166
+ name: 'authority';
1167
+ isMut: false;
1168
+ isSigner: true;
1169
+ docs: [
1170
+ 'Authority is verified through proof since both owner and delegate',
1171
+ 'are included in the token data hash, which is a public input to the',
1172
+ 'validity proof.'
1173
+ ];
1174
+ },
1175
+ {
1176
+ name: 'cpiAuthorityPda';
1177
+ isMut: false;
1178
+ isSigner: false;
1179
+ },
1180
+ {
1181
+ name: 'lightSystemProgram';
1182
+ isMut: false;
1183
+ isSigner: false;
1184
+ },
1185
+ {
1186
+ name: 'registeredProgramPda';
1187
+ isMut: false;
1188
+ isSigner: false;
1189
+ },
1190
+ {
1191
+ name: 'noopProgram';
1192
+ isMut: false;
1193
+ isSigner: false;
1194
+ },
1195
+ {
1196
+ name: 'accountCompressionAuthority';
1197
+ isMut: false;
1198
+ isSigner: false;
1199
+ },
1200
+ {
1201
+ name: 'accountCompressionProgram';
1202
+ isMut: false;
1203
+ isSigner: false;
1204
+ },
1205
+ {
1206
+ name: 'selfProgram';
1207
+ isMut: false;
1208
+ isSigner: false;
1209
+ docs: ['this program is the signer of the cpi.'];
1210
+ },
1211
+ {
1212
+ name: 'tokenPoolPda';
1213
+ isMut: true;
1214
+ isSigner: false;
1215
+ isOptional: true;
1216
+ },
1217
+ {
1218
+ name: 'compressOrDecompressTokenAccount';
1219
+ isMut: true;
1220
+ isSigner: false;
1221
+ isOptional: true;
1222
+ },
1223
+ {
1224
+ name: 'tokenProgram';
1225
+ isMut: false;
1226
+ isSigner: false;
1227
+ isOptional: true;
1228
+ },
1229
+ {
1230
+ name: 'systemProgram';
1231
+ isMut: false;
1232
+ isSigner: false;
1233
+ }
1234
+ ];
1235
+ args: [
1236
+ {
1237
+ name: 'inputs';
1238
+ type: 'bytes';
1239
+ }
1240
+ ];
1241
+ },
1242
+ {
1243
+ name: 'approve';
1244
+ docs: [
1245
+ 'Delegates an amount to a delegate. A compressed token account is either',
1246
+ 'completely delegated or not. Prior delegates are not preserved. Cannot',
1247
+ 'be called by a delegate.',
1248
+ 'The instruction creates two output accounts:',
1249
+ '1. one account with delegated amount',
1250
+ '2. one account with remaining(change) amount'
1251
+ ];
1252
+ accounts: [
1253
+ {
1254
+ name: 'feePayer';
1255
+ isMut: true;
1256
+ isSigner: true;
1257
+ docs: ['UNCHECKED: only pays fees.'];
1258
+ },
1259
+ {
1260
+ name: 'authority';
1261
+ isMut: false;
1262
+ isSigner: true;
1263
+ docs: [
1264
+ 'Authority is verified through proof since both owner and delegate',
1265
+ 'are included in the token data hash, which is a public input to the',
1266
+ 'validity proof.'
1267
+ ];
1268
+ },
1269
+ {
1270
+ name: 'cpiAuthorityPda';
1271
+ isMut: false;
1272
+ isSigner: false;
1273
+ },
1274
+ {
1275
+ name: 'lightSystemProgram';
1276
+ isMut: false;
1277
+ isSigner: false;
1278
+ },
1279
+ {
1280
+ name: 'registeredProgramPda';
1281
+ isMut: false;
1282
+ isSigner: false;
1283
+ },
1284
+ {
1285
+ name: 'noopProgram';
1286
+ isMut: false;
1287
+ isSigner: false;
1288
+ },
1289
+ {
1290
+ name: 'accountCompressionAuthority';
1291
+ isMut: false;
1292
+ isSigner: false;
1293
+ },
1294
+ {
1295
+ name: 'accountCompressionProgram';
1296
+ isMut: false;
1297
+ isSigner: false;
1298
+ },
1299
+ {
1300
+ name: 'selfProgram';
1301
+ isMut: false;
1302
+ isSigner: false;
1303
+ docs: ['this program is the signer of the cpi.'];
1304
+ },
1305
+ {
1306
+ name: 'systemProgram';
1307
+ isMut: false;
1308
+ isSigner: false;
1309
+ }
1310
+ ];
1311
+ args: [
1312
+ {
1313
+ name: 'inputs';
1314
+ type: 'bytes';
1315
+ }
1316
+ ];
1317
+ },
1318
+ {
1319
+ name: 'revoke';
1320
+ docs: [
1321
+ 'Revokes a delegation. The instruction merges all inputs into one output',
1322
+ 'account. Cannot be called by a delegate. Delegates are not preserved.'
1323
+ ];
1324
+ accounts: [
1325
+ {
1326
+ name: 'feePayer';
1327
+ isMut: true;
1328
+ isSigner: true;
1329
+ docs: ['UNCHECKED: only pays fees.'];
1330
+ },
1331
+ {
1332
+ name: 'authority';
1333
+ isMut: false;
1334
+ isSigner: true;
1335
+ docs: [
1336
+ 'Authority is verified through proof since both owner and delegate',
1337
+ 'are included in the token data hash, which is a public input to the',
1338
+ 'validity proof.'
1339
+ ];
1340
+ },
1341
+ {
1342
+ name: 'cpiAuthorityPda';
1343
+ isMut: false;
1344
+ isSigner: false;
1345
+ },
1346
+ {
1347
+ name: 'lightSystemProgram';
1348
+ isMut: false;
1349
+ isSigner: false;
1350
+ },
1351
+ {
1352
+ name: 'registeredProgramPda';
1353
+ isMut: false;
1354
+ isSigner: false;
1355
+ },
1356
+ {
1357
+ name: 'noopProgram';
1358
+ isMut: false;
1359
+ isSigner: false;
1360
+ },
1361
+ {
1362
+ name: 'accountCompressionAuthority';
1363
+ isMut: false;
1364
+ isSigner: false;
1365
+ },
1366
+ {
1367
+ name: 'accountCompressionProgram';
1368
+ isMut: false;
1369
+ isSigner: false;
1370
+ },
1371
+ {
1372
+ name: 'selfProgram';
1373
+ isMut: false;
1374
+ isSigner: false;
1375
+ docs: ['this program is the signer of the cpi.'];
1376
+ },
1377
+ {
1378
+ name: 'systemProgram';
1379
+ isMut: false;
1380
+ isSigner: false;
1381
+ }
1382
+ ];
1383
+ args: [
1384
+ {
1385
+ name: 'inputs';
1386
+ type: 'bytes';
1387
+ }
1388
+ ];
1389
+ },
1390
+ {
1391
+ name: 'freeze';
1392
+ docs: [
1393
+ 'Freezes compressed token accounts. Inputs must not be frozen. Creates as',
1394
+ 'many outputs as inputs. Balances and delegates are preserved.'
1395
+ ];
1396
+ accounts: [
1397
+ {
1398
+ name: 'feePayer';
1399
+ isMut: true;
1400
+ isSigner: true;
1401
+ docs: ['UNCHECKED: only pays fees.'];
1402
+ },
1403
+ {
1404
+ name: 'authority';
1405
+ isMut: false;
1406
+ isSigner: true;
1407
+ },
1408
+ {
1409
+ name: 'cpiAuthorityPda';
1410
+ isMut: false;
1411
+ isSigner: false;
1412
+ },
1413
+ {
1414
+ name: 'lightSystemProgram';
1415
+ isMut: false;
1416
+ isSigner: false;
1417
+ },
1418
+ {
1419
+ name: 'registeredProgramPda';
1420
+ isMut: false;
1421
+ isSigner: false;
1422
+ },
1423
+ {
1424
+ name: 'noopProgram';
1425
+ isMut: false;
1426
+ isSigner: false;
1427
+ },
1428
+ {
1429
+ name: 'accountCompressionAuthority';
1430
+ isMut: false;
1431
+ isSigner: false;
1432
+ },
1433
+ {
1434
+ name: 'accountCompressionProgram';
1435
+ isMut: false;
1436
+ isSigner: false;
1437
+ },
1438
+ {
1439
+ name: 'selfProgram';
1440
+ isMut: false;
1441
+ isSigner: false;
1442
+ docs: ['that this program is the signer of the cpi.'];
1443
+ },
1444
+ {
1445
+ name: 'systemProgram';
1446
+ isMut: false;
1447
+ isSigner: false;
1448
+ },
1449
+ {
1450
+ name: 'mint';
1451
+ isMut: false;
1452
+ isSigner: false;
1453
+ }
1454
+ ];
1455
+ args: [
1456
+ {
1457
+ name: 'inputs';
1458
+ type: 'bytes';
1459
+ }
1460
+ ];
1461
+ },
1462
+ {
1463
+ name: 'thaw';
1464
+ docs: [
1465
+ 'Thaws frozen compressed token accounts. Inputs must be frozen. Creates',
1466
+ 'as many outputs as inputs. Balances and delegates are preserved.'
1467
+ ];
1468
+ accounts: [
1469
+ {
1470
+ name: 'feePayer';
1471
+ isMut: true;
1472
+ isSigner: true;
1473
+ docs: ['UNCHECKED: only pays fees.'];
1474
+ },
1475
+ {
1476
+ name: 'authority';
1477
+ isMut: false;
1478
+ isSigner: true;
1479
+ },
1480
+ {
1481
+ name: 'cpiAuthorityPda';
1482
+ isMut: false;
1483
+ isSigner: false;
1484
+ },
1485
+ {
1486
+ name: 'lightSystemProgram';
1487
+ isMut: false;
1488
+ isSigner: false;
1489
+ },
1490
+ {
1491
+ name: 'registeredProgramPda';
1492
+ isMut: false;
1493
+ isSigner: false;
1494
+ },
1495
+ {
1496
+ name: 'noopProgram';
1497
+ isMut: false;
1498
+ isSigner: false;
1499
+ },
1500
+ {
1501
+ name: 'accountCompressionAuthority';
1502
+ isMut: false;
1503
+ isSigner: false;
1504
+ },
1505
+ {
1506
+ name: 'accountCompressionProgram';
1507
+ isMut: false;
1508
+ isSigner: false;
1509
+ },
1510
+ {
1511
+ name: 'selfProgram';
1512
+ isMut: false;
1513
+ isSigner: false;
1514
+ docs: ['that this program is the signer of the cpi.'];
1515
+ },
1516
+ {
1517
+ name: 'systemProgram';
1518
+ isMut: false;
1519
+ isSigner: false;
1520
+ },
1521
+ {
1522
+ name: 'mint';
1523
+ isMut: false;
1524
+ isSigner: false;
1525
+ }
1526
+ ];
1527
+ args: [
1528
+ {
1529
+ name: 'inputs';
1530
+ type: 'bytes';
1531
+ }
1532
+ ];
1533
+ },
1534
+ {
1535
+ name: 'burn';
1536
+ docs: [
1537
+ 'Burns compressed tokens and spl tokens from the pool account. Delegates',
1538
+ 'can burn tokens. The output compressed token account remains delegated.',
1539
+ 'Creates one output compressed token account.'
1540
+ ];
1541
+ accounts: [
1542
+ {
1543
+ name: 'feePayer';
1544
+ isMut: true;
1545
+ isSigner: true;
1546
+ docs: ['UNCHECKED: only pays fees.'];
1547
+ },
1548
+ {
1549
+ name: 'authority';
1550
+ isMut: false;
1551
+ isSigner: true;
1552
+ docs: [
1553
+ 'Authority is verified through proof since both owner and delegate',
1554
+ 'are included in the token data hash, which is a public input to the',
1555
+ 'validity proof.'
1556
+ ];
1557
+ },
1558
+ {
1559
+ name: 'cpiAuthorityPda';
1560
+ isMut: false;
1561
+ isSigner: false;
1562
+ },
1563
+ {
1564
+ name: 'mint';
1565
+ isMut: true;
1566
+ isSigner: false;
1567
+ },
1568
+ {
1569
+ name: 'tokenPoolPda';
1570
+ isMut: true;
1571
+ isSigner: false;
1572
+ },
1573
+ {
1574
+ name: 'tokenProgram';
1575
+ isMut: false;
1576
+ isSigner: false;
1577
+ },
1578
+ {
1579
+ name: 'lightSystemProgram';
1580
+ isMut: false;
1581
+ isSigner: false;
1582
+ },
1583
+ {
1584
+ name: 'registeredProgramPda';
1585
+ isMut: false;
1586
+ isSigner: false;
1587
+ },
1588
+ {
1589
+ name: 'noopProgram';
1590
+ isMut: false;
1591
+ isSigner: false;
1592
+ },
1593
+ {
1594
+ name: 'accountCompressionAuthority';
1595
+ isMut: false;
1596
+ isSigner: false;
1597
+ },
1598
+ {
1599
+ name: 'accountCompressionProgram';
1600
+ isMut: false;
1601
+ isSigner: false;
1602
+ },
1603
+ {
1604
+ name: 'selfProgram';
1605
+ isMut: false;
1606
+ isSigner: false;
1607
+ },
1608
+ {
1609
+ name: 'systemProgram';
1610
+ isMut: false;
1611
+ isSigner: false;
1612
+ }
1613
+ ];
1614
+ args: [
1615
+ {
1616
+ name: 'inputs';
1617
+ type: 'bytes';
1618
+ }
1619
+ ];
1620
+ },
1621
+ {
1622
+ name: 'stubIdlBuild';
1623
+ docs: [
1624
+ 'This function is a stub to allow Anchor to include the input types in',
1625
+ 'the IDL. It should not be included in production builds nor be called in',
1626
+ 'practice.'
1627
+ ];
1628
+ accounts: [
1629
+ {
1630
+ name: 'feePayer';
1631
+ isMut: true;
1632
+ isSigner: true;
1633
+ docs: ['UNCHECKED: only pays fees.'];
1634
+ },
1635
+ {
1636
+ name: 'authority';
1637
+ isMut: false;
1638
+ isSigner: true;
1639
+ docs: [
1640
+ 'Authority is verified through proof since both owner and delegate',
1641
+ 'are included in the token data hash, which is a public input to the',
1642
+ 'validity proof.'
1643
+ ];
1644
+ },
1645
+ {
1646
+ name: 'cpiAuthorityPda';
1647
+ isMut: false;
1648
+ isSigner: false;
1649
+ },
1650
+ {
1651
+ name: 'lightSystemProgram';
1652
+ isMut: false;
1653
+ isSigner: false;
1654
+ },
1655
+ {
1656
+ name: 'registeredProgramPda';
1657
+ isMut: false;
1658
+ isSigner: false;
1659
+ },
1660
+ {
1661
+ name: 'noopProgram';
1662
+ isMut: false;
1663
+ isSigner: false;
1664
+ },
1665
+ {
1666
+ name: 'accountCompressionAuthority';
1667
+ isMut: false;
1668
+ isSigner: false;
1669
+ },
1670
+ {
1671
+ name: 'accountCompressionProgram';
1672
+ isMut: false;
1673
+ isSigner: false;
1674
+ },
1675
+ {
1676
+ name: 'selfProgram';
1677
+ isMut: false;
1678
+ isSigner: false;
1679
+ docs: ['this program is the signer of the cpi.'];
1680
+ },
1681
+ {
1682
+ name: 'tokenPoolPda';
1683
+ isMut: true;
1684
+ isSigner: false;
1685
+ isOptional: true;
1686
+ },
1687
+ {
1688
+ name: 'compressOrDecompressTokenAccount';
1689
+ isMut: true;
1690
+ isSigner: false;
1691
+ isOptional: true;
1692
+ },
1693
+ {
1694
+ name: 'tokenProgram';
1695
+ isMut: false;
1696
+ isSigner: false;
1697
+ isOptional: true;
1698
+ },
1699
+ {
1700
+ name: 'systemProgram';
1701
+ isMut: false;
1702
+ isSigner: false;
1703
+ }
1704
+ ];
1705
+ args: [
1706
+ {
1707
+ name: 'inputs1';
1708
+ type: {
1709
+ defined: 'CompressedTokenInstructionDataTransfer';
1710
+ };
1711
+ },
1712
+ {
1713
+ name: 'inputs2';
1714
+ type: {
1715
+ defined: 'TokenData';
1716
+ };
1717
+ }
1718
+ ];
1719
+ }
1720
+ ];
1721
+ types: [
1722
+ {
1723
+ name: 'AccountState';
1724
+ type: {
1725
+ kind: 'enum';
1726
+ variants: [
1727
+ {
1728
+ name: 'Initialized';
1729
+ },
1730
+ {
1731
+ name: 'Frozen';
1732
+ }
1733
+ ];
1734
+ };
1735
+ },
1736
+ {
1737
+ name: 'CompressedAccount';
1738
+ type: {
1739
+ kind: 'struct';
1740
+ fields: [
1741
+ {
1742
+ name: 'owner';
1743
+ type: 'publicKey';
1744
+ },
1745
+ {
1746
+ name: 'lamports';
1747
+ type: 'u64';
1748
+ },
1749
+ {
1750
+ name: 'address';
1751
+ type: {
1752
+ option: {
1753
+ array: ['u8', 32];
1754
+ };
1755
+ };
1756
+ },
1757
+ {
1758
+ name: 'data';
1759
+ type: {
1760
+ option: {
1761
+ defined: 'CompressedAccountData';
1762
+ };
1763
+ };
1764
+ }
1765
+ ];
1766
+ };
1767
+ },
1768
+ {
1769
+ name: 'CompressedAccountData';
1770
+ type: {
1771
+ kind: 'struct';
1772
+ fields: [
1773
+ {
1774
+ name: 'discriminator';
1775
+ type: {
1776
+ array: ['u8', 8];
1777
+ };
1778
+ },
1779
+ {
1780
+ name: 'data';
1781
+ type: 'bytes';
1782
+ },
1783
+ {
1784
+ name: 'dataHash';
1785
+ type: {
1786
+ array: ['u8', 32];
1787
+ };
1788
+ }
1789
+ ];
1790
+ };
1791
+ },
1792
+ {
1793
+ name: 'CompressedCpiContext';
1794
+ type: {
1795
+ kind: 'struct';
1796
+ fields: [
1797
+ {
1798
+ name: 'setContext';
1799
+ docs: [
1800
+ 'Is set by the program that is invoking the CPI to signal that is should',
1801
+ 'set the cpi context.'
1802
+ ];
1803
+ type: 'bool';
1804
+ },
1805
+ {
1806
+ name: 'firstSetContext';
1807
+ docs: [
1808
+ 'Is set to wipe the cpi context since someone could have set it before',
1809
+ 'with unrelated data.'
1810
+ ];
1811
+ type: 'bool';
1812
+ },
1813
+ {
1814
+ name: 'cpiContextAccountIndex';
1815
+ docs: [
1816
+ 'Index of cpi context account in remaining accounts.'
1817
+ ];
1818
+ type: 'u8';
1819
+ }
1820
+ ];
1821
+ };
1822
+ },
1823
+ {
1824
+ name: 'CompressedProof';
1825
+ type: {
1826
+ kind: 'struct';
1827
+ fields: [
1828
+ {
1829
+ name: 'a';
1830
+ type: {
1831
+ array: ['u8', 32];
1832
+ };
1833
+ },
1834
+ {
1835
+ name: 'b';
1836
+ type: {
1837
+ array: ['u8', 64];
1838
+ };
1839
+ },
1840
+ {
1841
+ name: 'c';
1842
+ type: {
1843
+ array: ['u8', 32];
1844
+ };
1845
+ }
1846
+ ];
1847
+ };
1848
+ },
1849
+ {
1850
+ name: 'CompressedTokenInstructionDataTransfer';
1851
+ type: {
1852
+ kind: 'struct';
1853
+ fields: [
1854
+ {
1855
+ name: 'proof';
1856
+ type: {
1857
+ option: {
1858
+ defined: 'CompressedProof';
1859
+ };
1860
+ };
1861
+ },
1862
+ {
1863
+ name: 'mint';
1864
+ type: 'publicKey';
1865
+ },
1866
+ {
1867
+ name: 'delegatedTransfer';
1868
+ docs: [
1869
+ 'Is required if the signer is delegate,',
1870
+ '-> delegate is authority account,',
1871
+ 'owner = Some(owner) is the owner of the token account.'
1872
+ ];
1873
+ type: {
1874
+ option: {
1875
+ defined: 'DelegatedTransfer';
1876
+ };
1877
+ };
1878
+ },
1879
+ {
1880
+ name: 'inputTokenDataWithContext';
1881
+ type: {
1882
+ vec: {
1883
+ defined: 'InputTokenDataWithContext';
1884
+ };
1885
+ };
1886
+ },
1887
+ {
1888
+ name: 'outputCompressedAccounts';
1889
+ type: {
1890
+ vec: {
1891
+ defined: 'PackedTokenTransferOutputData';
1892
+ };
1893
+ };
1894
+ },
1895
+ {
1896
+ name: 'isCompress';
1897
+ type: 'bool';
1898
+ },
1899
+ {
1900
+ name: 'compressOrDecompressAmount';
1901
+ type: {
1902
+ option: 'u64';
1903
+ };
1904
+ },
1905
+ {
1906
+ name: 'cpiContext';
1907
+ type: {
1908
+ option: {
1909
+ defined: 'CompressedCpiContext';
1910
+ };
1911
+ };
1912
+ },
1913
+ {
1914
+ name: 'lamportsChangeAccountMerkleTreeIndex';
1915
+ type: {
1916
+ option: 'u8';
1917
+ };
1918
+ }
1919
+ ];
1920
+ };
1921
+ },
1922
+ {
1923
+ name: 'DelegatedTransfer';
1924
+ docs: [
1925
+ 'Struct to provide the owner when the delegate is signer of the transaction.'
1926
+ ];
1927
+ type: {
1928
+ kind: 'struct';
1929
+ fields: [
1930
+ {
1931
+ name: 'owner';
1932
+ type: 'publicKey';
1933
+ },
1934
+ {
1935
+ name: 'delegateChangeAccountIndex';
1936
+ docs: [
1937
+ 'Index of change compressed account in output compressed accounts. In',
1938
+ "case that the delegate didn't spend the complete delegated compressed",
1939
+ 'account balance the change compressed account will be delegated to her',
1940
+ 'as well.'
1941
+ ];
1942
+ type: {
1943
+ option: 'u8';
1944
+ };
1945
+ }
1946
+ ];
1947
+ };
1948
+ },
1949
+ {
1950
+ name: 'InputTokenDataWithContext';
1951
+ type: {
1952
+ kind: 'struct';
1953
+ fields: [
1954
+ {
1955
+ name: 'amount';
1956
+ type: 'u64';
1957
+ },
1958
+ {
1959
+ name: 'delegateIndex';
1960
+ type: {
1961
+ option: 'u8';
1962
+ };
1963
+ },
1964
+ {
1965
+ name: 'merkleContext';
1966
+ type: {
1967
+ defined: 'PackedMerkleContext';
1968
+ };
1969
+ },
1970
+ {
1971
+ name: 'rootIndex';
1972
+ type: 'u16';
1973
+ },
1974
+ {
1975
+ name: 'lamports';
1976
+ type: {
1977
+ option: 'u64';
1978
+ };
1979
+ },
1980
+ {
1981
+ name: 'tlv';
1982
+ docs: [
1983
+ 'Placeholder for TokenExtension tlv data (unimplemented)'
1984
+ ];
1985
+ type: {
1986
+ option: 'bytes';
1987
+ };
1988
+ }
1989
+ ];
1990
+ };
1991
+ },
1992
+ {
1993
+ name: 'InstructionDataInvoke';
1994
+ type: {
1995
+ kind: 'struct';
1996
+ fields: [
1997
+ {
1998
+ name: 'proof';
1999
+ type: {
2000
+ option: {
2001
+ defined: 'CompressedProof';
2002
+ };
2003
+ };
2004
+ },
2005
+ {
2006
+ name: 'inputCompressedAccountsWithMerkleContext';
2007
+ type: {
2008
+ vec: {
2009
+ defined: 'PackedCompressedAccountWithMerkleContext';
2010
+ };
2011
+ };
2012
+ },
2013
+ {
2014
+ name: 'outputCompressedAccounts';
2015
+ type: {
2016
+ vec: {
2017
+ defined: 'OutputCompressedAccountWithPackedContext';
2018
+ };
2019
+ };
2020
+ },
2021
+ {
2022
+ name: 'relayFee';
2023
+ type: {
2024
+ option: 'u64';
2025
+ };
2026
+ },
2027
+ {
2028
+ name: 'newAddressParams';
2029
+ type: {
2030
+ vec: {
2031
+ defined: 'NewAddressParamsPacked';
2032
+ };
2033
+ };
2034
+ },
2035
+ {
2036
+ name: 'compressOrDecompressLamports';
2037
+ type: {
2038
+ option: 'u64';
2039
+ };
2040
+ },
2041
+ {
2042
+ name: 'isCompress';
2043
+ type: 'bool';
2044
+ }
2045
+ ];
2046
+ };
2047
+ },
2048
+ {
2049
+ name: 'InstructionDataInvokeCpi';
2050
+ type: {
2051
+ kind: 'struct';
2052
+ fields: [
2053
+ {
2054
+ name: 'proof';
2055
+ type: {
2056
+ option: {
2057
+ defined: 'CompressedProof';
2058
+ };
2059
+ };
2060
+ },
2061
+ {
2062
+ name: 'newAddressParams';
2063
+ type: {
2064
+ vec: {
2065
+ defined: 'NewAddressParamsPacked';
2066
+ };
2067
+ };
2068
+ },
2069
+ {
2070
+ name: 'inputCompressedAccountsWithMerkleContext';
2071
+ type: {
2072
+ vec: {
2073
+ defined: 'PackedCompressedAccountWithMerkleContext';
2074
+ };
2075
+ };
2076
+ },
2077
+ {
2078
+ name: 'outputCompressedAccounts';
2079
+ type: {
2080
+ vec: {
2081
+ defined: 'OutputCompressedAccountWithPackedContext';
2082
+ };
2083
+ };
2084
+ },
2085
+ {
2086
+ name: 'relayFee';
2087
+ type: {
2088
+ option: 'u64';
2089
+ };
2090
+ },
2091
+ {
2092
+ name: 'compressOrDecompressLamports';
2093
+ type: {
2094
+ option: 'u64';
2095
+ };
2096
+ },
2097
+ {
2098
+ name: 'isCompress';
2099
+ type: 'bool';
2100
+ },
2101
+ {
2102
+ name: 'cpiContext';
2103
+ type: {
2104
+ option: {
2105
+ defined: 'CompressedCpiContext';
2106
+ };
2107
+ };
2108
+ }
2109
+ ];
2110
+ };
2111
+ },
2112
+ {
2113
+ name: 'MerkleTreeSequenceNumber';
2114
+ type: {
2115
+ kind: 'struct';
2116
+ fields: [
2117
+ {
2118
+ name: 'pubkey';
2119
+ type: 'publicKey';
2120
+ },
2121
+ {
2122
+ name: 'seq';
2123
+ type: 'u64';
2124
+ }
2125
+ ];
2126
+ };
2127
+ },
2128
+ {
2129
+ name: 'NewAddressParamsPacked';
2130
+ type: {
2131
+ kind: 'struct';
2132
+ fields: [
2133
+ {
2134
+ name: 'seed';
2135
+ type: {
2136
+ array: ['u8', 32];
2137
+ };
2138
+ },
2139
+ {
2140
+ name: 'addressQueueAccountIndex';
2141
+ type: 'u8';
2142
+ },
2143
+ {
2144
+ name: 'addressMerkleTreeAccountIndex';
2145
+ type: 'u8';
2146
+ },
2147
+ {
2148
+ name: 'addressMerkleTreeRootIndex';
2149
+ type: 'u16';
2150
+ }
2151
+ ];
2152
+ };
2153
+ },
2154
+ {
2155
+ name: 'OutputCompressedAccountWithPackedContext';
2156
+ type: {
2157
+ kind: 'struct';
2158
+ fields: [
2159
+ {
2160
+ name: 'compressedAccount';
2161
+ type: {
2162
+ defined: 'CompressedAccount';
2163
+ };
2164
+ },
2165
+ {
2166
+ name: 'merkleTreeIndex';
2167
+ type: 'u8';
2168
+ }
2169
+ ];
2170
+ };
2171
+ },
2172
+ {
2173
+ name: 'PackedCompressedAccountWithMerkleContext';
2174
+ type: {
2175
+ kind: 'struct';
2176
+ fields: [
2177
+ {
2178
+ name: 'compressedAccount';
2179
+ type: {
2180
+ defined: 'CompressedAccount';
2181
+ };
2182
+ },
2183
+ {
2184
+ name: 'merkleContext';
2185
+ type: {
2186
+ defined: 'PackedMerkleContext';
2187
+ };
2188
+ },
2189
+ {
2190
+ name: 'rootIndex';
2191
+ docs: [
2192
+ 'Index of root used in inclusion validity proof.'
2193
+ ];
2194
+ type: 'u16';
2195
+ },
2196
+ {
2197
+ name: 'readOnly';
2198
+ docs: [
2199
+ 'Placeholder to mark accounts read-only unimplemented set to false.'
2200
+ ];
2201
+ type: 'bool';
2202
+ }
2203
+ ];
2204
+ };
2205
+ },
2206
+ {
2207
+ name: 'PackedMerkleContext';
2208
+ type: {
2209
+ kind: 'struct';
2210
+ fields: [
2211
+ {
2212
+ name: 'merkleTreePubkeyIndex';
2213
+ type: 'u8';
2214
+ },
2215
+ {
2216
+ name: 'nullifierQueuePubkeyIndex';
2217
+ type: 'u8';
2218
+ },
2219
+ {
2220
+ name: 'leafIndex';
2221
+ type: 'u32';
2222
+ },
2223
+ {
2224
+ name: 'queueIndex';
2225
+ type: {
2226
+ option: {
2227
+ defined: 'QueueIndex';
2228
+ };
2229
+ };
2230
+ }
2231
+ ];
2232
+ };
2233
+ },
2234
+ {
2235
+ name: 'PackedTokenTransferOutputData';
2236
+ type: {
2237
+ kind: 'struct';
2238
+ fields: [
2239
+ {
2240
+ name: 'owner';
2241
+ type: 'publicKey';
2242
+ },
2243
+ {
2244
+ name: 'amount';
2245
+ type: 'u64';
2246
+ },
2247
+ {
2248
+ name: 'lamports';
2249
+ type: {
2250
+ option: 'u64';
2251
+ };
2252
+ },
2253
+ {
2254
+ name: 'merkleTreeIndex';
2255
+ type: 'u8';
2256
+ },
2257
+ {
2258
+ name: 'tlv';
2259
+ docs: [
2260
+ 'Placeholder for TokenExtension tlv data (unimplemented)'
2261
+ ];
2262
+ type: {
2263
+ option: 'bytes';
2264
+ };
2265
+ }
2266
+ ];
2267
+ };
2268
+ },
2269
+ {
2270
+ name: 'PublicTransactionEvent';
2271
+ type: {
2272
+ kind: 'struct';
2273
+ fields: [
2274
+ {
2275
+ name: 'inputCompressedAccountHashes';
2276
+ type: {
2277
+ vec: {
2278
+ array: ['u8', 32];
2279
+ };
2280
+ };
2281
+ },
2282
+ {
2283
+ name: 'outputCompressedAccountHashes';
2284
+ type: {
2285
+ vec: {
2286
+ array: ['u8', 32];
2287
+ };
2288
+ };
2289
+ },
2290
+ {
2291
+ name: 'outputCompressedAccounts';
2292
+ type: {
2293
+ vec: {
2294
+ defined: 'OutputCompressedAccountWithPackedContext';
2295
+ };
2296
+ };
2297
+ },
2298
+ {
2299
+ name: 'outputLeafIndices';
2300
+ type: {
2301
+ vec: 'u32';
2302
+ };
2303
+ },
2304
+ {
2305
+ name: 'sequenceNumbers';
2306
+ type: {
2307
+ vec: {
2308
+ defined: 'MerkleTreeSequenceNumber';
2309
+ };
2310
+ };
2311
+ },
2312
+ {
2313
+ name: 'relayFee';
2314
+ type: {
2315
+ option: 'u64';
2316
+ };
2317
+ },
2318
+ {
2319
+ name: 'isCompress';
2320
+ type: 'bool';
2321
+ },
2322
+ {
2323
+ name: 'compressOrDecompressLamports';
2324
+ type: {
2325
+ option: 'u64';
2326
+ };
2327
+ },
2328
+ {
2329
+ name: 'pubkeyArray';
2330
+ type: {
2331
+ vec: 'publicKey';
2332
+ };
2333
+ },
2334
+ {
2335
+ name: 'message';
2336
+ type: {
2337
+ option: 'bytes';
2338
+ };
2339
+ }
2340
+ ];
2341
+ };
2342
+ },
2343
+ {
2344
+ name: 'QueueIndex';
2345
+ type: {
2346
+ kind: 'struct';
2347
+ fields: [
2348
+ {
2349
+ name: 'queueId';
2350
+ docs: ['Id of queue in queue account.'];
2351
+ type: 'u8';
2352
+ },
2353
+ {
2354
+ name: 'index';
2355
+ docs: ['Index of compressed account hash in queue.'];
2356
+ type: 'u16';
2357
+ }
2358
+ ];
2359
+ };
2360
+ },
2361
+ {
2362
+ name: 'TokenData';
2363
+ type: {
2364
+ kind: 'struct';
2365
+ fields: [
2366
+ {
2367
+ name: 'mint';
2368
+ docs: ['The mint associated with this account'];
2369
+ type: 'publicKey';
2370
+ },
2371
+ {
2372
+ name: 'owner';
2373
+ docs: ['The owner of this account.'];
2374
+ type: 'publicKey';
2375
+ },
2376
+ {
2377
+ name: 'amount';
2378
+ docs: ['The amount of tokens this account holds.'];
2379
+ type: 'u64';
2380
+ },
2381
+ {
2382
+ name: 'delegate';
2383
+ docs: [
2384
+ 'If `delegate` is `Some` then `delegated_amount` represents',
2385
+ 'the amount authorized by the delegate'
2386
+ ];
2387
+ type: {
2388
+ option: 'publicKey';
2389
+ };
2390
+ },
2391
+ {
2392
+ name: 'state';
2393
+ docs: ["The account's state"];
2394
+ type: {
2395
+ defined: 'AccountState';
2396
+ };
2397
+ },
2398
+ {
2399
+ name: 'tlv';
2400
+ docs: [
2401
+ 'Placeholder for TokenExtension tlv data (unimplemented)'
2402
+ ];
2403
+ type: {
2404
+ option: 'bytes';
2405
+ };
2406
+ }
2407
+ ];
2408
+ };
2409
+ }
2410
+ ];
2411
+ errors: [
2412
+ {
2413
+ code: 6000;
2414
+ name: 'PublicKeyAmountMissmatch';
2415
+ msg: 'public keys and amounts must be of same length';
2416
+ },
2417
+ {
2418
+ code: 6001;
2419
+ name: 'ComputeInputSumFailed';
2420
+ msg: 'ComputeInputSumFailed';
2421
+ },
2422
+ {
2423
+ code: 6002;
2424
+ name: 'ComputeOutputSumFailed';
2425
+ msg: 'ComputeOutputSumFailed';
2426
+ },
2427
+ {
2428
+ code: 6003;
2429
+ name: 'ComputeCompressSumFailed';
2430
+ msg: 'ComputeCompressSumFailed';
2431
+ },
2432
+ {
2433
+ code: 6004;
2434
+ name: 'ComputeDecompressSumFailed';
2435
+ msg: 'ComputeDecompressSumFailed';
2436
+ },
2437
+ {
2438
+ code: 6005;
2439
+ name: 'SumCheckFailed';
2440
+ msg: 'SumCheckFailed';
2441
+ },
2442
+ {
2443
+ code: 6006;
2444
+ name: 'DecompressRecipientUndefinedForDecompress';
2445
+ msg: 'DecompressRecipientUndefinedForDecompress';
2446
+ },
2447
+ {
2448
+ code: 6007;
2449
+ name: 'CompressedPdaUndefinedForDecompress';
2450
+ msg: 'CompressedPdaUndefinedForDecompress';
2451
+ },
2452
+ {
2453
+ code: 6008;
2454
+ name: 'DeCompressAmountUndefinedForDecompress';
2455
+ msg: 'DeCompressAmountUndefinedForDecompress';
2456
+ },
2457
+ {
2458
+ code: 6009;
2459
+ name: 'CompressedPdaUndefinedForCompress';
2460
+ msg: 'CompressedPdaUndefinedForCompress';
2461
+ },
2462
+ {
2463
+ code: 6010;
2464
+ name: 'DeCompressAmountUndefinedForCompress';
2465
+ msg: 'DeCompressAmountUndefinedForCompress';
2466
+ },
2467
+ {
2468
+ code: 6011;
2469
+ name: 'DelegateSignerCheckFailed';
2470
+ msg: 'DelegateSignerCheckFailed';
2471
+ },
2472
+ {
2473
+ code: 6012;
2474
+ name: 'MintTooLarge';
2475
+ msg: 'Minted amount greater than u64::MAX';
2476
+ },
2477
+ {
2478
+ code: 6013;
2479
+ name: 'SplTokenSupplyMismatch';
2480
+ msg: 'SplTokenSupplyMismatch';
2481
+ },
2482
+ {
2483
+ code: 6014;
2484
+ name: 'HeapMemoryCheckFailed';
2485
+ msg: 'HeapMemoryCheckFailed';
2486
+ },
2487
+ {
2488
+ code: 6015;
2489
+ name: 'InstructionNotCallable';
2490
+ msg: 'The instruction is not callable';
2491
+ },
2492
+ {
2493
+ code: 6016;
2494
+ name: 'ArithmeticUnderflow';
2495
+ msg: 'ArithmeticUnderflow';
2496
+ },
2497
+ {
2498
+ code: 6017;
2499
+ name: 'HashToFieldError';
2500
+ msg: 'HashToFieldError';
2501
+ },
2502
+ {
2503
+ code: 6018;
2504
+ name: 'InvalidAuthorityMint';
2505
+ msg: 'Expected the authority to be also a mint authority';
2506
+ },
2507
+ {
2508
+ code: 6019;
2509
+ name: 'InvalidFreezeAuthority';
2510
+ msg: 'Provided authority is not the freeze authority';
2511
+ },
2512
+ {
2513
+ code: 6020;
2514
+ name: 'InvalidDelegateIndex';
2515
+ },
2516
+ {
2517
+ code: 6021;
2518
+ name: 'TokenPoolPdaUndefined';
2519
+ },
2520
+ {
2521
+ code: 6022;
2522
+ name: 'IsTokenPoolPda';
2523
+ msg: 'Compress or decompress recipient is the same account as the token pool pda.';
2524
+ },
2525
+ {
2526
+ code: 6023;
2527
+ name: 'InvalidTokenPoolPda';
2528
+ },
2529
+ {
2530
+ code: 6024;
2531
+ name: 'NoInputTokenAccountsProvided';
2532
+ },
2533
+ {
2534
+ code: 6025;
2535
+ name: 'NoInputsProvided';
2536
+ },
2537
+ {
2538
+ code: 6026;
2539
+ name: 'MintHasNoFreezeAuthority';
2540
+ },
2541
+ {
2542
+ code: 6027;
2543
+ name: 'MintWithInvalidExtension';
2544
+ },
2545
+ {
2546
+ code: 6028;
2547
+ name: 'InsufficientTokenAccountBalance';
2548
+ msg: 'The token account balance is less than the remaining amount.';
2549
+ },
2550
+ {
2551
+ code: 6029;
2552
+ name: 'InvalidTokenPoolBump';
2553
+ msg: 'Max number of token pools reached.';
2554
+ },
2555
+ {
2556
+ code: 6030;
2557
+ name: 'FailedToDecompress';
2558
+ },
2559
+ {
2560
+ code: 6031;
2561
+ name: 'FailedToBurnSplTokensFromTokenPool';
2562
+ },
2563
+ {
2564
+ code: 6032;
2565
+ name: 'NoMatchingBumpFound';
2566
+ }
2567
+ ];
2568
+ };
2569
+ declare const IDL: LightCompressedToken;
2570
+
2571
+ export { type ApproveAndMintToParams, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedCpiContext, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, CpiContextLayout, type CreateMintParams, type CreateTokenProgramLookupTableParams, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, IDL, type InputTokenDataWithContext, type LightCompressedToken, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintToInstructionData, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, TRANSFER_DISCRIMINATOR, type TokenData, type TokenTransferOutputData, type TransferParams, type approveAccountsLayoutParams, approveAndMintTo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, createDecompressOutputState, createMint, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferOutputState, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeTransferInstructionData, decompress, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeTransferInstructionData, type freezeAccountsLayoutParams, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintToLayout, packCompressedTokenAccounts, parseTokenData, type revokeAccountsLayoutParams, selectMinCompressedTokenAccountsForTransfer, sumUpTokenAmount, type thawAccountsLayoutParams, transfer, transferAccountsLayout, type transferAccountsLayoutParams, validateSameTokenOwner };