@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
package/dist/cjs/node/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var anchor = require('@coral-xyz/anchor');
|
|
|
6
6
|
var require$$0 = require('buffer');
|
|
7
7
|
|
|
8
8
|
const IDL = {
|
|
9
|
-
version: '0.
|
|
9
|
+
version: '1.0.0',
|
|
10
10
|
name: 'light_compressed_token',
|
|
11
11
|
instructions: [
|
|
12
12
|
{
|
|
@@ -1154,12 +1154,6 @@ const IDL = {
|
|
|
1154
1154
|
name: 'isCompress',
|
|
1155
1155
|
type: 'bool',
|
|
1156
1156
|
},
|
|
1157
|
-
{
|
|
1158
|
-
name: 'signerSeeds',
|
|
1159
|
-
type: {
|
|
1160
|
-
vec: 'bytes',
|
|
1161
|
-
},
|
|
1162
|
-
},
|
|
1163
1157
|
{
|
|
1164
1158
|
name: 'cpiContext',
|
|
1165
1159
|
type: {
|
|
@@ -1792,7 +1786,7 @@ var Layout$1 = {};
|
|
|
1792
1786
|
* THE SOFTWARE.
|
|
1793
1787
|
*/
|
|
1794
1788
|
Object.defineProperty(Layout$1, "__esModule", { value: true });
|
|
1795
|
-
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;
|
|
1789
|
+
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;
|
|
1796
1790
|
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;
|
|
1797
1791
|
const buffer_1 = require$$0;
|
|
1798
1792
|
/* Check if a value is a Uint8Array.
|
|
@@ -1939,7 +1933,7 @@ class Layout {
|
|
|
1939
1933
|
return undefined;
|
|
1940
1934
|
}
|
|
1941
1935
|
}
|
|
1942
|
-
Layout$1.Layout = Layout;
|
|
1936
|
+
var Layout_2 = Layout$1.Layout = Layout;
|
|
1943
1937
|
/* Provide text that carries a name (such as for a function that will
|
|
1944
1938
|
* be throwing an error) annotated with the property of a given layout
|
|
1945
1939
|
* (such as one for which the value was unacceptable).
|
|
@@ -4265,6 +4259,8 @@ var TokenInstruction;
|
|
|
4265
4259
|
// ConfidentialTransferFeeExtension = 37,
|
|
4266
4260
|
// WithdrawalExcessLamports = 38,
|
|
4267
4261
|
TokenInstruction[TokenInstruction["MetadataPointerExtension"] = 39] = "MetadataPointerExtension";
|
|
4262
|
+
TokenInstruction[TokenInstruction["GroupPointerExtension"] = 40] = "GroupPointerExtension";
|
|
4263
|
+
TokenInstruction[TokenInstruction["GroupMemberPointerExtension"] = 41] = "GroupMemberPointerExtension";
|
|
4268
4264
|
})(TokenInstruction || (TokenInstruction = {}));
|
|
4269
4265
|
|
|
4270
4266
|
/** @internal */
|
|
@@ -4421,6 +4417,38 @@ function getAssociatedTokenAddressSync(mint, owner, allowOwnerOffCurve = false,
|
|
|
4421
4417
|
return address;
|
|
4422
4418
|
}
|
|
4423
4419
|
|
|
4420
|
+
class COptionPublicKeyLayout extends Layout_2 {
|
|
4421
|
+
constructor(property) {
|
|
4422
|
+
super(-1, property);
|
|
4423
|
+
this.publicKeyLayout = publicKey();
|
|
4424
|
+
}
|
|
4425
|
+
decode(buffer, offset = 0) {
|
|
4426
|
+
const option = buffer[offset];
|
|
4427
|
+
if (option === 0) {
|
|
4428
|
+
return null;
|
|
4429
|
+
}
|
|
4430
|
+
return this.publicKeyLayout.decode(buffer, offset + 1);
|
|
4431
|
+
}
|
|
4432
|
+
encode(src, buffer, offset = 0) {
|
|
4433
|
+
if (src === null) {
|
|
4434
|
+
buffer[offset] = 0;
|
|
4435
|
+
return 1;
|
|
4436
|
+
}
|
|
4437
|
+
else {
|
|
4438
|
+
buffer[offset] = 1;
|
|
4439
|
+
this.publicKeyLayout.encode(src, buffer, offset + 1);
|
|
4440
|
+
return 33;
|
|
4441
|
+
}
|
|
4442
|
+
}
|
|
4443
|
+
getSpan(buffer, offset = 0) {
|
|
4444
|
+
if (buffer) {
|
|
4445
|
+
const option = buffer[offset];
|
|
4446
|
+
return option === 0 ? 1 : 1 + this.publicKeyLayout.span;
|
|
4447
|
+
}
|
|
4448
|
+
return 1 + this.publicKeyLayout.span;
|
|
4449
|
+
}
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4424
4452
|
/**
|
|
4425
4453
|
* Construct a CreateAssociatedTokenAccount instruction
|
|
4426
4454
|
*
|
|
@@ -4457,8 +4485,7 @@ const initializeMint2InstructionData = struct([
|
|
|
4457
4485
|
u8('instruction'),
|
|
4458
4486
|
u8('decimals'),
|
|
4459
4487
|
publicKey('mintAuthority'),
|
|
4460
|
-
|
|
4461
|
-
publicKey('freezeAuthority'),
|
|
4488
|
+
new COptionPublicKeyLayout('freezeAuthority'),
|
|
4462
4489
|
]);
|
|
4463
4490
|
/**
|
|
4464
4491
|
* Construct an InitializeMint2 instruction
|
|
@@ -4478,8 +4505,7 @@ function createInitializeMint2Instruction(mint, decimals, mintAuthority, freezeA
|
|
|
4478
4505
|
instruction: TokenInstruction.InitializeMint2,
|
|
4479
4506
|
decimals,
|
|
4480
4507
|
mintAuthority,
|
|
4481
|
-
|
|
4482
|
-
freezeAuthority: freezeAuthority || new web3_js.PublicKey(0),
|
|
4508
|
+
freezeAuthority,
|
|
4483
4509
|
}, data);
|
|
4484
4510
|
return new web3_js.TransactionInstruction({ keys, programId, data });
|
|
4485
4511
|
}
|
|
@@ -4873,9 +4899,6 @@ class CompressedTokenProgram {
|
|
|
4873
4899
|
stateless_js.defaultTestStateTreeAccounts().addressQueue,
|
|
4874
4900
|
this.programId,
|
|
4875
4901
|
TOKEN_PROGRAM_ID,
|
|
4876
|
-
web3_js.SystemProgram.programId,
|
|
4877
|
-
web3_js.ComputeBudgetProgram.programId,
|
|
4878
|
-
ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
4879
4902
|
authority,
|
|
4880
4903
|
...optionalMintKeys,
|
|
4881
4904
|
...(remainingAccounts !== null && remainingAccounts !== void 0 ? remainingAccounts : []),
|