@lightprotocol/compressed-token 0.3.1 → 0.3.3

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.
@@ -5,11 +5,11 @@ var web3_js = require('@solana/web3.js');
5
5
  var anchor = require('@coral-xyz/anchor');
6
6
 
7
7
  const IDL = {
8
- version: '0.4.0',
8
+ version: '0.4.1',
9
9
  name: 'light_compressed_token',
10
10
  instructions: [
11
11
  {
12
- name: 'createMint',
12
+ name: 'createTokenPool',
13
13
  docs: [
14
14
  'This instruction expects a mint account to be created in a separate',
15
15
  'token program instruction with token authority as mint authority. This',
@@ -881,12 +881,6 @@ const IDL = {
881
881
  option: 'u8',
882
882
  },
883
883
  },
884
- {
885
- name: 'isNative',
886
- type: {
887
- option: 'u64',
888
- },
889
- },
890
884
  {
891
885
  name: 'merkleContext',
892
886
  type: {
@@ -897,6 +891,12 @@ const IDL = {
897
891
  name: 'rootIndex',
898
892
  type: 'u16',
899
893
  },
894
+ {
895
+ name: 'lamports',
896
+ type: {
897
+ option: 'u64',
898
+ },
899
+ },
900
900
  ],
901
901
  },
902
902
  },
@@ -1347,18 +1347,6 @@ const IDL = {
1347
1347
  defined: 'AccountState',
1348
1348
  },
1349
1349
  },
1350
- {
1351
- name: 'isNative',
1352
- docs: [
1353
- 'If is_some, this is a native token, and the value logs the rent-exempt',
1354
- 'reserve. An Account is required to be rent-exempt, so the value is',
1355
- 'used by the Processor to ensure that wrapped SOL accounts do not',
1356
- 'drop below this threshold.',
1357
- ],
1358
- type: {
1359
- option: 'u64',
1360
- },
1361
- },
1362
1350
  ],
1363
1351
  },
1364
1352
  },
@@ -1494,13 +1482,15 @@ function packCompressedTokenAccounts(params) {
1494
1482
  packedInputTokenData.push({
1495
1483
  amount: account.parsed.amount,
1496
1484
  delegateIndex,
1497
- isNative: account.parsed.isNative,
1498
1485
  merkleContext: {
1499
1486
  merkleTreePubkeyIndex,
1500
1487
  nullifierQueuePubkeyIndex,
1501
1488
  leafIndex: account.compressedAccount.leafIndex,
1502
1489
  },
1503
1490
  rootIndex: rootIndices[index],
1491
+ lamports: account.compressedAccount.lamports.eq(stateless_js.bn(0))
1492
+ ? null
1493
+ : account.compressedAccount.lamports,
1504
1494
  });
1505
1495
  });
1506
1496
  /// pack output state trees
@@ -6539,7 +6529,7 @@ class CompressedTokenProgram {
6539
6529
  space: MINT_SIZE,
6540
6530
  });
6541
6531
  const initializeMintInstruction = createInitializeMint2Instruction(mint, params.decimals, authority, params.freezeAuthority, TOKEN_PROGRAM_ID);
6542
- const ix = await this.registerMint({
6532
+ const ix = await this.createTokenPool({
6543
6533
  feePayer,
6544
6534
  mint,
6545
6535
  });
@@ -6549,11 +6539,11 @@ class CompressedTokenProgram {
6549
6539
  * Enable compression for an existing SPL mint, creating an omnibus account.
6550
6540
  * For new mints, use `CompressedTokenProgram.createMint`.
6551
6541
  */
6552
- static async registerMint(params) {
6542
+ static async createTokenPool(params) {
6553
6543
  const { mint, feePayer } = params;
6554
6544
  const tokenPoolPda = this.deriveTokenPoolPda(mint);
6555
6545
  const ix = await this.program.methods
6556
- .createMint()
6546
+ .createTokenPool()
6557
6547
  .accounts({
6558
6548
  mint,
6559
6549
  feePayer,
@@ -7030,8 +7020,8 @@ async function mintTo(rpc, payer, mint, destination, authority, amount, merkleTr
7030
7020
  *
7031
7021
  * @return transaction signature
7032
7022
  */
7033
- async function registerMint(rpc, payer, mintAddress, confirmOptions) {
7034
- const ix = await CompressedTokenProgram.registerMint({
7023
+ async function createTokenPool(rpc, payer, mintAddress, confirmOptions) {
7024
+ const ix = await CompressedTokenProgram.createTokenPool({
7035
7025
  feePayer: payer.publicKey,
7036
7026
  mint: mintAddress,
7037
7027
  });
@@ -7050,12 +7040,12 @@ exports.approveAndMintTo = approveAndMintTo;
7050
7040
  exports.compress = compress;
7051
7041
  exports.createDecompressOutputState = createDecompressOutputState;
7052
7042
  exports.createMint = createMint;
7043
+ exports.createTokenPool = createTokenPool;
7053
7044
  exports.createTransferOutputState = createTransferOutputState;
7054
7045
  exports.decompress = decompress;
7055
7046
  exports.mintTo = mintTo;
7056
7047
  exports.packCompressedTokenAccounts = packCompressedTokenAccounts;
7057
7048
  exports.parseTokenData = parseTokenData;
7058
- exports.registerMint = registerMint;
7059
7049
  exports.selectMinCompressedTokenAccountsForTransfer = selectMinCompressedTokenAccountsForTransfer;
7060
7050
  exports.sumUpTokenAmount = sumUpTokenAmount;
7061
7051
  exports.transfer = transfer;