@lightprotocol/compressed-token 0.3.1 → 0.3.2

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.
@@ -3,11 +3,11 @@ import { PublicKey, AccountMeta, TransactionInstruction, Signer, ConfirmOptions,
3
3
  import { BN, Program } from '@coral-xyz/anchor';
4
4
 
5
5
  type LightCompressedToken = {
6
- version: '0.4.0';
6
+ version: '0.4.1';
7
7
  name: 'light_compressed_token';
8
8
  instructions: [
9
9
  {
10
- name: 'createMint';
10
+ name: 'createTokenPool';
11
11
  docs: [
12
12
  'This instruction expects a mint account to be created in a separate',
13
13
  'token program instruction with token authority as mint authority. This',
@@ -879,12 +879,6 @@ type LightCompressedToken = {
879
879
  option: 'u8';
880
880
  };
881
881
  },
882
- {
883
- name: 'isNative';
884
- type: {
885
- option: 'u64';
886
- };
887
- },
888
882
  {
889
883
  name: 'merkleContext';
890
884
  type: {
@@ -894,6 +888,12 @@ type LightCompressedToken = {
894
888
  {
895
889
  name: 'rootIndex';
896
890
  type: 'u16';
891
+ },
892
+ {
893
+ name: 'lamports';
894
+ type: {
895
+ option: 'u64';
896
+ };
897
897
  }
898
898
  ];
899
899
  };
@@ -1344,18 +1344,6 @@ type LightCompressedToken = {
1344
1344
  type: {
1345
1345
  defined: 'AccountState';
1346
1346
  };
1347
- },
1348
- {
1349
- name: 'isNative';
1350
- docs: [
1351
- 'If is_some, this is a native token, and the value logs the rent-exempt',
1352
- 'reserve. An Account is required to be rent-exempt, so the value is',
1353
- 'used by the Processor to ensure that wrapped SOL accounts do not',
1354
- 'drop below this threshold.'
1355
- ];
1356
- type: {
1357
- option: 'u64';
1358
- };
1359
1347
  }
1360
1348
  ];
1361
1349
  };
@@ -1364,108 +1352,23 @@ type LightCompressedToken = {
1364
1352
  errors: [
1365
1353
  {
1366
1354
  code: 6000;
1367
- name: 'PublicKeyAmountMissmatch';
1368
- msg: 'public keys and amounts must be of same length';
1355
+ name: 'SignerCheckFailed';
1356
+ msg: 'Signer check failed';
1369
1357
  },
1370
1358
  {
1371
1359
  code: 6001;
1372
- name: 'SignerCheckFailed';
1373
- msg: 'SignerCheckFailed';
1360
+ name: 'CreateTransferInstructionFailed';
1361
+ msg: 'Create transfer instruction failed';
1374
1362
  },
1375
1363
  {
1376
1364
  code: 6002;
1377
- name: 'ComputeInputSumFailed';
1378
- msg: 'ComputeInputSumFailed';
1365
+ name: 'AccountNotFound';
1366
+ msg: 'Account not found';
1379
1367
  },
1380
1368
  {
1381
1369
  code: 6003;
1382
- name: 'ComputeOutputSumFailed';
1383
- msg: 'ComputeOutputSumFailed';
1384
- },
1385
- {
1386
- code: 6004;
1387
- name: 'ComputeCompressSumFailed';
1388
- msg: 'ComputeCompressSumFailed';
1389
- },
1390
- {
1391
- code: 6005;
1392
- name: 'ComputeDecompressSumFailed';
1393
- msg: 'ComputeDecompressSumFailed';
1394
- },
1395
- {
1396
- code: 6006;
1397
- name: 'SumCheckFailed';
1398
- msg: 'SumCheckFailed';
1399
- },
1400
- {
1401
- code: 6007;
1402
- name: 'DecompressRecipientUndefinedForDecompress';
1403
- msg: 'DecompressRecipientUndefinedForDecompress';
1404
- },
1405
- {
1406
- code: 6008;
1407
- name: 'CompressedPdaUndefinedForDecompress';
1408
- msg: 'CompressedPdaUndefinedForDecompress';
1409
- },
1410
- {
1411
- code: 6009;
1412
- name: 'DeCompressAmountUndefinedForDecompress';
1413
- msg: 'DeCompressAmountUndefinedForDecompress';
1414
- },
1415
- {
1416
- code: 6010;
1417
- name: 'CompressedPdaUndefinedForCompress';
1418
- msg: 'CompressedPdaUndefinedForCompress';
1419
- },
1420
- {
1421
- code: 6011;
1422
- name: 'DeCompressAmountUndefinedForCompress';
1423
- msg: 'DeCompressAmountUndefinedForCompress';
1424
- },
1425
- {
1426
- code: 6012;
1427
- name: 'DelegateUndefined';
1428
- msg: 'DelegateUndefined while delegated amount is defined';
1429
- },
1430
- {
1431
- code: 6013;
1432
- name: 'DelegateSignerCheckFailed';
1433
- msg: 'DelegateSignerCheckFailed';
1434
- },
1435
- {
1436
- code: 6014;
1437
- name: 'SplTokenSupplyMismatch';
1438
- msg: 'SplTokenSupplyMismatch';
1439
- },
1440
- {
1441
- code: 6015;
1442
- name: 'HeapMemoryCheckFailed';
1443
- msg: 'HeapMemoryCheckFailed';
1444
- },
1445
- {
1446
- code: 6016;
1447
- name: 'InstructionNotCallable';
1448
- msg: 'The instruction is not callable';
1449
- },
1450
- {
1451
- code: 6017;
1452
- name: 'ArithmeticUnderflow';
1453
- msg: 'ArithmeticUnderflow';
1454
- },
1455
- {
1456
- code: 6018;
1457
- name: 'InvalidDelegate';
1458
- msg: 'InvalidDelegate';
1459
- },
1460
- {
1461
- code: 6019;
1462
- name: 'HashToFieldError';
1463
- msg: 'HashToFieldError';
1464
- },
1465
- {
1466
- code: 6020;
1467
- name: 'InvalidMint';
1468
- msg: 'InvalidMint';
1370
+ name: 'SerializationError';
1371
+ msg: 'Serialization error';
1469
1372
  }
1470
1373
  ];
1471
1374
  };
@@ -1512,10 +1415,6 @@ type InputTokenDataWithContext = {
1512
1415
  * Optional: The index of the delegate in remaining accounts
1513
1416
  */
1514
1417
  delegateIndex: number | null;
1515
- /**
1516
- * Optional: Whether the token is native (wSOL)
1517
- */
1518
- isNative: BN | null;
1519
1418
  /**
1520
1419
  * The index of the merkle tree address in remaining accounts
1521
1420
  */
@@ -1528,6 +1427,10 @@ type InputTokenDataWithContext = {
1528
1427
  * The index of the leaf in the merkle tree
1529
1428
  */
1530
1429
  leafIndex: number;
1430
+ /**
1431
+ * Lamports in the input token account.
1432
+ */
1433
+ lamports: BN | null;
1531
1434
  };
1532
1435
  type CompressedTokenInstructionDataInvoke = {
1533
1436
  /**
@@ -1583,13 +1486,6 @@ type TokenData = {
1583
1486
  * The account's state
1584
1487
  */
1585
1488
  state: number;
1586
- /**
1587
- * If is_some, this is a native token, and the value logs the rent-exempt
1588
- * reserve. An Account is required to be rent-exempt, so the value is used
1589
- * by the Processor to ensure that wrapped SOL accounts do not drop below
1590
- * this threshold.
1591
- */
1592
- isNative: BN | null;
1593
1489
  };
1594
1490
 
1595
1491
  type PackCompressedTokenAccountsParams = {
@@ -1887,7 +1783,7 @@ declare class CompressedTokenProgram {
1887
1783
  * Enable compression for an existing SPL mint, creating an omnibus account.
1888
1784
  * For new mints, use `CompressedTokenProgram.createMint`.
1889
1785
  */
1890
- static registerMint(params: RegisterMintParams): Promise<TransactionInstruction>;
1786
+ static createTokenPool(params: RegisterMintParams): Promise<TransactionInstruction>;
1891
1787
  /**
1892
1788
  * Construct mintTo instruction for compressed tokens
1893
1789
  */
@@ -2013,7 +1909,7 @@ declare function mintTo(rpc: Rpc, payer: Signer, mint: PublicKey, destination: P
2013
1909
  *
2014
1910
  * @return transaction signature
2015
1911
  */
2016
- declare function registerMint(rpc: Rpc, payer: Signer, mintAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
1912
+ declare function createTokenPool(rpc: Rpc, payer: Signer, mintAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2017
1913
 
2018
1914
  /**
2019
1915
  * Transfer compressed tokens from one owner to another
@@ -2046,4 +1942,4 @@ declare function selectMinCompressedTokenAccountsForTransfer(accounts: ParsedTok
2046
1942
  totalLamports: BN | null
2047
1943
  ];
2048
1944
 
2049
- export { type ApproveAndMintToParams, CPI_AUTHORITY_SEED, type CompressedTokenInstructionDataInvoke, CompressedTokenProgram, type CreateMintParams, IDL, type InputTokenDataWithContext, type LightCompressedToken, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type TokenData, type TokenTransferOutputData, type TransferParams, approveAndMintTo, compress, createDecompressOutputState, createMint, createTransferOutputState, decompress, mintTo, packCompressedTokenAccounts, parseTokenData, registerMint, selectMinCompressedTokenAccountsForTransfer, sumUpTokenAmount, transfer, validateSameTokenOwner };
1945
+ export { type ApproveAndMintToParams, CPI_AUTHORITY_SEED, type CompressedTokenInstructionDataInvoke, CompressedTokenProgram, type CreateMintParams, IDL, type InputTokenDataWithContext, type LightCompressedToken, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type TokenData, type TokenTransferOutputData, type TransferParams, approveAndMintTo, compress, createDecompressOutputState, createMint, createTokenPool, createTransferOutputState, decompress, mintTo, packCompressedTokenAccounts, parseTokenData, selectMinCompressedTokenAccountsForTransfer, sumUpTokenAmount, transfer, validateSameTokenOwner };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightprotocol/compressed-token",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "JS client to interact with the compressed-token program",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  "license": "Apache-2.0",
43
43
  "peerDependencies": {
44
44
  "@solana/web3.js": "^1.91.8",
45
- "@lightprotocol/stateless.js": "0.4.1"
45
+ "@lightprotocol/stateless.js": "0.4.2"
46
46
  },
47
47
  "dependencies": {
48
48
  "@coral-xyz/anchor": "0.29.0",