@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.
- package/dist/cjs/browser/index.cjs +39 -16
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +39 -16
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +39 -16
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -7
- package/package.json +20 -19
|
@@ -5,7 +5,7 @@ var web3_js = require('@solana/web3.js');
|
|
|
5
5
|
var anchor = require('@coral-xyz/anchor');
|
|
6
6
|
|
|
7
7
|
const IDL = {
|
|
8
|
-
version: '0.
|
|
8
|
+
version: '1.0.0',
|
|
9
9
|
name: 'light_compressed_token',
|
|
10
10
|
instructions: [
|
|
11
11
|
{
|
|
@@ -1153,12 +1153,6 @@ const IDL = {
|
|
|
1153
1153
|
name: 'isCompress',
|
|
1154
1154
|
type: 'bool',
|
|
1155
1155
|
},
|
|
1156
|
-
{
|
|
1157
|
-
name: 'signerSeeds',
|
|
1158
|
-
type: {
|
|
1159
|
-
vec: 'bytes',
|
|
1160
|
-
},
|
|
1161
|
-
},
|
|
1162
1156
|
{
|
|
1163
1157
|
name: 'cpiContext',
|
|
1164
1158
|
type: {
|
|
@@ -3815,7 +3809,7 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_buffer);
|
|
|
3815
3809
|
* THE SOFTWARE.
|
|
3816
3810
|
*/
|
|
3817
3811
|
Object.defineProperty(Layout$1, "__esModule", { value: true });
|
|
3818
|
-
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;
|
|
3812
|
+
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;
|
|
3819
3813
|
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;
|
|
3820
3814
|
const buffer_1 = require$$0;
|
|
3821
3815
|
/* Check if a value is a Uint8Array.
|
|
@@ -3962,7 +3956,7 @@ class Layout {
|
|
|
3962
3956
|
return undefined;
|
|
3963
3957
|
}
|
|
3964
3958
|
}
|
|
3965
|
-
Layout$1.Layout = Layout;
|
|
3959
|
+
var Layout_2 = Layout$1.Layout = Layout;
|
|
3966
3960
|
/* Provide text that carries a name (such as for a function that will
|
|
3967
3961
|
* be throwing an error) annotated with the property of a given layout
|
|
3968
3962
|
* (such as one for which the value was unacceptable).
|
|
@@ -6288,6 +6282,8 @@ var TokenInstruction;
|
|
|
6288
6282
|
// ConfidentialTransferFeeExtension = 37,
|
|
6289
6283
|
// WithdrawalExcessLamports = 38,
|
|
6290
6284
|
TokenInstruction[TokenInstruction["MetadataPointerExtension"] = 39] = "MetadataPointerExtension";
|
|
6285
|
+
TokenInstruction[TokenInstruction["GroupPointerExtension"] = 40] = "GroupPointerExtension";
|
|
6286
|
+
TokenInstruction[TokenInstruction["GroupMemberPointerExtension"] = 41] = "GroupMemberPointerExtension";
|
|
6291
6287
|
})(TokenInstruction || (TokenInstruction = {}));
|
|
6292
6288
|
|
|
6293
6289
|
/** @internal */
|
|
@@ -6444,6 +6440,38 @@ function getAssociatedTokenAddressSync(mint, owner, allowOwnerOffCurve = false,
|
|
|
6444
6440
|
return address;
|
|
6445
6441
|
}
|
|
6446
6442
|
|
|
6443
|
+
class COptionPublicKeyLayout extends Layout_2 {
|
|
6444
|
+
constructor(property) {
|
|
6445
|
+
super(-1, property);
|
|
6446
|
+
this.publicKeyLayout = publicKey();
|
|
6447
|
+
}
|
|
6448
|
+
decode(buffer, offset = 0) {
|
|
6449
|
+
const option = buffer[offset];
|
|
6450
|
+
if (option === 0) {
|
|
6451
|
+
return null;
|
|
6452
|
+
}
|
|
6453
|
+
return this.publicKeyLayout.decode(buffer, offset + 1);
|
|
6454
|
+
}
|
|
6455
|
+
encode(src, buffer, offset = 0) {
|
|
6456
|
+
if (src === null) {
|
|
6457
|
+
buffer[offset] = 0;
|
|
6458
|
+
return 1;
|
|
6459
|
+
}
|
|
6460
|
+
else {
|
|
6461
|
+
buffer[offset] = 1;
|
|
6462
|
+
this.publicKeyLayout.encode(src, buffer, offset + 1);
|
|
6463
|
+
return 33;
|
|
6464
|
+
}
|
|
6465
|
+
}
|
|
6466
|
+
getSpan(buffer, offset = 0) {
|
|
6467
|
+
if (buffer) {
|
|
6468
|
+
const option = buffer[offset];
|
|
6469
|
+
return option === 0 ? 1 : 1 + this.publicKeyLayout.span;
|
|
6470
|
+
}
|
|
6471
|
+
return 1 + this.publicKeyLayout.span;
|
|
6472
|
+
}
|
|
6473
|
+
}
|
|
6474
|
+
|
|
6447
6475
|
/**
|
|
6448
6476
|
* Construct a CreateAssociatedTokenAccount instruction
|
|
6449
6477
|
*
|
|
@@ -6480,8 +6508,7 @@ const initializeMint2InstructionData = struct([
|
|
|
6480
6508
|
u8('instruction'),
|
|
6481
6509
|
u8('decimals'),
|
|
6482
6510
|
publicKey('mintAuthority'),
|
|
6483
|
-
|
|
6484
|
-
publicKey('freezeAuthority'),
|
|
6511
|
+
new COptionPublicKeyLayout('freezeAuthority'),
|
|
6485
6512
|
]);
|
|
6486
6513
|
/**
|
|
6487
6514
|
* Construct an InitializeMint2 instruction
|
|
@@ -6501,8 +6528,7 @@ function createInitializeMint2Instruction(mint, decimals, mintAuthority, freezeA
|
|
|
6501
6528
|
instruction: TokenInstruction.InitializeMint2,
|
|
6502
6529
|
decimals,
|
|
6503
6530
|
mintAuthority,
|
|
6504
|
-
|
|
6505
|
-
freezeAuthority: freezeAuthority || new web3_js.PublicKey(0),
|
|
6531
|
+
freezeAuthority,
|
|
6506
6532
|
}, data);
|
|
6507
6533
|
return new web3_js.TransactionInstruction({ keys, programId, data });
|
|
6508
6534
|
}
|
|
@@ -6896,9 +6922,6 @@ class CompressedTokenProgram {
|
|
|
6896
6922
|
stateless_js.defaultTestStateTreeAccounts().addressQueue,
|
|
6897
6923
|
this.programId,
|
|
6898
6924
|
TOKEN_PROGRAM_ID,
|
|
6899
|
-
web3_js.SystemProgram.programId,
|
|
6900
|
-
web3_js.ComputeBudgetProgram.programId,
|
|
6901
|
-
ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
6902
6925
|
authority,
|
|
6903
6926
|
...optionalMintKeys,
|
|
6904
6927
|
...(remainingAccounts !== null && remainingAccounts !== void 0 ? remainingAccounts : []),
|