@lightprotocol/compressed-token 0.11.1 → 0.12.0

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,7 +3,7 @@ import { PublicKey, SystemProgram, TransactionInstruction, Transaction, sendAndC
3
3
  import { AnchorProvider, setProvider, Program, BN } from '@coral-xyz/anchor';
4
4
 
5
5
  const IDL = {
6
- version: '0.6.2',
6
+ version: '1.0.0',
7
7
  name: 'light_compressed_token',
8
8
  instructions: [
9
9
  {
@@ -1151,12 +1151,6 @@ const IDL = {
1151
1151
  name: 'isCompress',
1152
1152
  type: 'bool',
1153
1153
  },
1154
- {
1155
- name: 'signerSeeds',
1156
- type: {
1157
- vec: 'bytes',
1158
- },
1159
- },
1160
1154
  {
1161
1155
  name: 'cpiContext',
1162
1156
  type: {
@@ -3812,7 +3806,7 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_buffer);
3812
3806
  * THE SOFTWARE.
3813
3807
  */
3814
3808
  Object.defineProperty(Layout$1, "__esModule", { value: true });
3815
- Layout$1.s16 = Layout$1.s8 = Layout$1.nu64be = Layout$1.u48be = Layout$1.u40be = Layout$1.u32be = Layout$1.u24be = Layout$1.u16be = Layout$1.nu64 = Layout$1.u48 = Layout$1.u40 = u32 = Layout$1.u32 = Layout$1.u24 = Layout$1.u16 = u8 = Layout$1.u8 = Layout$1.offset = Layout$1.greedy = Layout$1.Constant = Layout$1.UTF8 = Layout$1.CString = Layout$1.Blob = Layout$1.Boolean = Layout$1.BitField = Layout$1.BitStructure = Layout$1.VariantLayout = Layout$1.Union = Layout$1.UnionLayoutDiscriminator = Layout$1.UnionDiscriminator = Layout$1.Structure = Layout$1.Sequence = Layout$1.DoubleBE = Layout$1.Double = Layout$1.FloatBE = Layout$1.Float = Layout$1.NearInt64BE = Layout$1.NearInt64 = Layout$1.NearUInt64BE = Layout$1.NearUInt64 = Layout$1.IntBE = Layout$1.Int = Layout$1.UIntBE = Layout$1.UInt = Layout$1.OffsetLayout = Layout$1.GreedyCount = Layout$1.ExternalLayout = Layout$1.bindConstructorLayout = Layout$1.nameWithProperty = Layout$1.Layout = Layout$1.uint8ArrayToBuffer = Layout$1.checkUint8Array = void 0;
3809
+ Layout$1.s16 = Layout$1.s8 = Layout$1.nu64be = Layout$1.u48be = Layout$1.u40be = Layout$1.u32be = Layout$1.u24be = Layout$1.u16be = Layout$1.nu64 = Layout$1.u48 = Layout$1.u40 = u32 = Layout$1.u32 = Layout$1.u24 = Layout$1.u16 = u8 = Layout$1.u8 = Layout$1.offset = Layout$1.greedy = Layout$1.Constant = Layout$1.UTF8 = Layout$1.CString = Layout$1.Blob = Layout$1.Boolean = Layout$1.BitField = Layout$1.BitStructure = Layout$1.VariantLayout = Layout$1.Union = Layout$1.UnionLayoutDiscriminator = Layout$1.UnionDiscriminator = Layout$1.Structure = Layout$1.Sequence = Layout$1.DoubleBE = Layout$1.Double = Layout$1.FloatBE = Layout$1.Float = Layout$1.NearInt64BE = Layout$1.NearInt64 = Layout$1.NearUInt64BE = Layout$1.NearUInt64 = Layout$1.IntBE = Layout$1.Int = Layout$1.UIntBE = Layout$1.UInt = Layout$1.OffsetLayout = Layout$1.GreedyCount = Layout$1.ExternalLayout = Layout$1.bindConstructorLayout = Layout$1.nameWithProperty = Layout_2 = Layout$1.Layout = Layout$1.uint8ArrayToBuffer = Layout$1.checkUint8Array = void 0;
3816
3810
  Layout$1.constant = Layout$1.utf8 = Layout$1.cstr = blob = Layout$1.blob = Layout$1.unionLayoutDiscriminator = Layout$1.union = Layout$1.seq = Layout$1.bits = struct = Layout$1.struct = Layout$1.f64be = Layout$1.f64 = Layout$1.f32be = Layout$1.f32 = Layout$1.ns64be = Layout$1.s48be = Layout$1.s40be = Layout$1.s32be = Layout$1.s24be = Layout$1.s16be = Layout$1.ns64 = Layout$1.s48 = Layout$1.s40 = Layout$1.s32 = Layout$1.s24 = void 0;
3817
3811
  const buffer_1 = require$$0;
3818
3812
  /* Check if a value is a Uint8Array.
@@ -3959,7 +3953,7 @@ class Layout {
3959
3953
  return undefined;
3960
3954
  }
3961
3955
  }
3962
- Layout$1.Layout = Layout;
3956
+ var Layout_2 = Layout$1.Layout = Layout;
3963
3957
  /* Provide text that carries a name (such as for a function that will
3964
3958
  * be throwing an error) annotated with the property of a given layout
3965
3959
  * (such as one for which the value was unacceptable).
@@ -6285,6 +6279,8 @@ var TokenInstruction;
6285
6279
  // ConfidentialTransferFeeExtension = 37,
6286
6280
  // WithdrawalExcessLamports = 38,
6287
6281
  TokenInstruction[TokenInstruction["MetadataPointerExtension"] = 39] = "MetadataPointerExtension";
6282
+ TokenInstruction[TokenInstruction["GroupPointerExtension"] = 40] = "GroupPointerExtension";
6283
+ TokenInstruction[TokenInstruction["GroupMemberPointerExtension"] = 41] = "GroupMemberPointerExtension";
6288
6284
  })(TokenInstruction || (TokenInstruction = {}));
6289
6285
 
6290
6286
  /** @internal */
@@ -6441,6 +6437,38 @@ function getAssociatedTokenAddressSync(mint, owner, allowOwnerOffCurve = false,
6441
6437
  return address;
6442
6438
  }
6443
6439
 
6440
+ class COptionPublicKeyLayout extends Layout_2 {
6441
+ constructor(property) {
6442
+ super(-1, property);
6443
+ this.publicKeyLayout = publicKey();
6444
+ }
6445
+ decode(buffer, offset = 0) {
6446
+ const option = buffer[offset];
6447
+ if (option === 0) {
6448
+ return null;
6449
+ }
6450
+ return this.publicKeyLayout.decode(buffer, offset + 1);
6451
+ }
6452
+ encode(src, buffer, offset = 0) {
6453
+ if (src === null) {
6454
+ buffer[offset] = 0;
6455
+ return 1;
6456
+ }
6457
+ else {
6458
+ buffer[offset] = 1;
6459
+ this.publicKeyLayout.encode(src, buffer, offset + 1);
6460
+ return 33;
6461
+ }
6462
+ }
6463
+ getSpan(buffer, offset = 0) {
6464
+ if (buffer) {
6465
+ const option = buffer[offset];
6466
+ return option === 0 ? 1 : 1 + this.publicKeyLayout.span;
6467
+ }
6468
+ return 1 + this.publicKeyLayout.span;
6469
+ }
6470
+ }
6471
+
6444
6472
  /**
6445
6473
  * Construct a CreateAssociatedTokenAccount instruction
6446
6474
  *
@@ -6477,8 +6505,7 @@ const initializeMint2InstructionData = struct([
6477
6505
  u8('instruction'),
6478
6506
  u8('decimals'),
6479
6507
  publicKey('mintAuthority'),
6480
- u8('freezeAuthorityOption'),
6481
- publicKey('freezeAuthority'),
6508
+ new COptionPublicKeyLayout('freezeAuthority'),
6482
6509
  ]);
6483
6510
  /**
6484
6511
  * Construct an InitializeMint2 instruction
@@ -6498,8 +6525,7 @@ function createInitializeMint2Instruction(mint, decimals, mintAuthority, freezeA
6498
6525
  instruction: TokenInstruction.InitializeMint2,
6499
6526
  decimals,
6500
6527
  mintAuthority,
6501
- freezeAuthorityOption: freezeAuthority ? 1 : 0,
6502
- freezeAuthority: freezeAuthority || new PublicKey(0),
6528
+ freezeAuthority,
6503
6529
  }, data);
6504
6530
  return new TransactionInstruction({ keys, programId, data });
6505
6531
  }
@@ -6898,9 +6924,6 @@ class CompressedTokenProgram {
6898
6924
  defaultTestStateTreeAccounts().addressQueue,
6899
6925
  this.programId,
6900
6926
  TOKEN_PROGRAM_ID,
6901
- SystemProgram.programId,
6902
- ComputeBudgetProgram.programId,
6903
- ASSOCIATED_TOKEN_PROGRAM_ID,
6904
6927
  authority,
6905
6928
  ...optionalMintKeys,
6906
6929
  ...(remainingAccounts ?? []),