@solana-program/token-wrap 2.2.0 → 2.3.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.
package/dist/src/index.js CHANGED
@@ -255,7 +255,7 @@ function getCloseStuckEscrowInstruction(input, config) {
255
255
  accounts.token2022Program.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
256
256
  }
257
257
  const getAccountMeta = getAccountMetaFactory(programAddress);
258
- const instruction = {
258
+ return Object.freeze({
259
259
  accounts: [
260
260
  getAccountMeta(accounts.escrow),
261
261
  getAccountMeta(accounts.destination),
@@ -264,10 +264,9 @@ function getCloseStuckEscrowInstruction(input, config) {
264
264
  getAccountMeta(accounts.wrappedMintAuthority),
265
265
  getAccountMeta(accounts.token2022Program)
266
266
  ],
267
- programAddress,
268
- data: getCloseStuckEscrowInstructionDataEncoder().encode({})
269
- };
270
- return instruction;
267
+ data: getCloseStuckEscrowInstructionDataEncoder().encode({}),
268
+ programAddress
269
+ });
271
270
  }
272
271
  function parseCloseStuckEscrowInstruction(instruction) {
273
272
  if (instruction.accounts.length < 6) {
@@ -343,7 +342,7 @@ function getCreateMintInstruction(input, config) {
343
342
  accounts.systemProgram.value = "11111111111111111111111111111111";
344
343
  }
345
344
  const getAccountMeta = getAccountMetaFactory(programAddress);
346
- const instruction = {
345
+ return Object.freeze({
347
346
  accounts: [
348
347
  getAccountMeta(accounts.wrappedMint),
349
348
  getAccountMeta(accounts.backpointer),
@@ -351,12 +350,11 @@ function getCreateMintInstruction(input, config) {
351
350
  getAccountMeta(accounts.systemProgram),
352
351
  getAccountMeta(accounts.wrappedTokenProgram)
353
352
  ],
354
- programAddress,
355
353
  data: getCreateMintInstructionDataEncoder().encode(
356
354
  args
357
- )
358
- };
359
- return instruction;
355
+ ),
356
+ programAddress
357
+ });
360
358
  }
361
359
  function parseCreateMintInstruction(instruction) {
362
360
  if (instruction.accounts.length < 5) {
@@ -439,7 +437,7 @@ function getSyncMetadataToSplTokenInstruction(input, config) {
439
437
  accounts.rentSysvar.value = "SysvarRent111111111111111111111111111111111";
440
438
  }
441
439
  const getAccountMeta = getAccountMetaFactory(programAddress);
442
- const instruction = {
440
+ return Object.freeze({
443
441
  accounts: [
444
442
  getAccountMeta(accounts.metaplexMetadata),
445
443
  getAccountMeta(accounts.wrappedMintAuthority),
@@ -451,10 +449,9 @@ function getSyncMetadataToSplTokenInstruction(input, config) {
451
449
  getAccountMeta(accounts.sourceMetadata),
452
450
  getAccountMeta(accounts.ownerProgram)
453
451
  ],
454
- programAddress,
455
- data: getSyncMetadataToSplTokenInstructionDataEncoder().encode({})
456
- };
457
- return instruction;
452
+ data: getSyncMetadataToSplTokenInstructionDataEncoder().encode({}),
453
+ programAddress
454
+ });
458
455
  }
459
456
  function parseSyncMetadataToSplTokenInstruction(instruction) {
460
457
  if (instruction.accounts.length < 9) {
@@ -531,7 +528,7 @@ function getSyncMetadataToToken2022Instruction(input, config) {
531
528
  accounts.token2022Program.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
532
529
  }
533
530
  const getAccountMeta = getAccountMetaFactory(programAddress);
534
- const instruction = {
531
+ return Object.freeze({
535
532
  accounts: [
536
533
  getAccountMeta(accounts.wrappedMint),
537
534
  getAccountMeta(accounts.wrappedMintAuthority),
@@ -540,10 +537,9 @@ function getSyncMetadataToToken2022Instruction(input, config) {
540
537
  getAccountMeta(accounts.sourceMetadata),
541
538
  getAccountMeta(accounts.ownerProgram)
542
539
  ],
543
- programAddress,
544
- data: getSyncMetadataToToken2022InstructionDataEncoder().encode({})
545
- };
546
- return instruction;
540
+ data: getSyncMetadataToToken2022InstructionDataEncoder().encode({}),
541
+ programAddress
542
+ });
547
543
  }
548
544
  function parseSyncMetadataToToken2022Instruction(instruction) {
549
545
  if (instruction.accounts.length < 6) {
@@ -640,7 +636,7 @@ function getUnwrapInstruction(input, config) {
640
636
  })
641
637
  );
642
638
  const getAccountMeta = getAccountMetaFactory(programAddress);
643
- const instruction = {
639
+ return Object.freeze({
644
640
  accounts: [
645
641
  getAccountMeta(accounts.unwrappedEscrow),
646
642
  getAccountMeta(accounts.recipientUnwrappedToken),
@@ -653,12 +649,11 @@ function getUnwrapInstruction(input, config) {
653
649
  getAccountMeta(accounts.transferAuthority),
654
650
  ...remainingAccounts
655
651
  ],
656
- programAddress,
657
652
  data: getUnwrapInstructionDataEncoder().encode(
658
653
  args
659
- )
660
- };
661
- return instruction;
654
+ ),
655
+ programAddress
656
+ });
662
657
  }
663
658
  function parseUnwrapInstruction(instruction) {
664
659
  if (instruction.accounts.length < 9) {
@@ -752,7 +747,7 @@ function getWrapInstruction(input, config) {
752
747
  })
753
748
  );
754
749
  const getAccountMeta = getAccountMetaFactory(programAddress);
755
- const instruction = {
750
+ return Object.freeze({
756
751
  accounts: [
757
752
  getAccountMeta(accounts.recipientWrappedTokenAccount),
758
753
  getAccountMeta(accounts.wrappedMint),
@@ -765,12 +760,11 @@ function getWrapInstruction(input, config) {
765
760
  getAccountMeta(accounts.transferAuthority),
766
761
  ...remainingAccounts
767
762
  ],
768
- programAddress,
769
763
  data: getWrapInstructionDataEncoder().encode(
770
764
  args
771
- )
772
- };
773
- return instruction;
765
+ ),
766
+ programAddress
767
+ });
774
768
  }
775
769
  function parseWrapInstruction(instruction) {
776
770
  if (instruction.accounts.length < 9) {