@lightprotocol/stateless.js 0.15.0 → 0.15.2
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/README.md +5 -21
- package/dist/cjs/browser/index.cjs +104 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +104 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +104 -1
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +103 -0
- package/package.json +1 -1
package/dist/es/browser/index.js
CHANGED
|
@@ -10372,6 +10372,106 @@ const IDL = {
|
|
|
10372
10372
|
},
|
|
10373
10373
|
],
|
|
10374
10374
|
},
|
|
10375
|
+
{
|
|
10376
|
+
name: 'compressSplTokenAccount',
|
|
10377
|
+
accounts: [
|
|
10378
|
+
{
|
|
10379
|
+
name: 'feePayer',
|
|
10380
|
+
isMut: true,
|
|
10381
|
+
isSigner: true,
|
|
10382
|
+
docs: ['UNCHECKED: only pays fees.'],
|
|
10383
|
+
},
|
|
10384
|
+
{
|
|
10385
|
+
name: 'authority',
|
|
10386
|
+
isMut: false,
|
|
10387
|
+
isSigner: true,
|
|
10388
|
+
docs: [
|
|
10389
|
+
'Authority is verified through proof since both owner and delegate',
|
|
10390
|
+
'are included in the token data hash, which is a public input to the',
|
|
10391
|
+
'validity proof.',
|
|
10392
|
+
],
|
|
10393
|
+
},
|
|
10394
|
+
{
|
|
10395
|
+
name: 'cpiAuthorityPda',
|
|
10396
|
+
isMut: false,
|
|
10397
|
+
isSigner: false,
|
|
10398
|
+
},
|
|
10399
|
+
{
|
|
10400
|
+
name: 'lightSystemProgram',
|
|
10401
|
+
isMut: false,
|
|
10402
|
+
isSigner: false,
|
|
10403
|
+
},
|
|
10404
|
+
{
|
|
10405
|
+
name: 'registeredProgramPda',
|
|
10406
|
+
isMut: false,
|
|
10407
|
+
isSigner: false,
|
|
10408
|
+
},
|
|
10409
|
+
{
|
|
10410
|
+
name: 'noopProgram',
|
|
10411
|
+
isMut: false,
|
|
10412
|
+
isSigner: false,
|
|
10413
|
+
},
|
|
10414
|
+
{
|
|
10415
|
+
name: 'accountCompressionAuthority',
|
|
10416
|
+
isMut: false,
|
|
10417
|
+
isSigner: false,
|
|
10418
|
+
},
|
|
10419
|
+
{
|
|
10420
|
+
name: 'accountCompressionProgram',
|
|
10421
|
+
isMut: false,
|
|
10422
|
+
isSigner: false,
|
|
10423
|
+
},
|
|
10424
|
+
{
|
|
10425
|
+
name: 'selfProgram',
|
|
10426
|
+
isMut: false,
|
|
10427
|
+
isSigner: false,
|
|
10428
|
+
docs: ['this program is the signer of the cpi.'],
|
|
10429
|
+
},
|
|
10430
|
+
{
|
|
10431
|
+
name: 'tokenPoolPda',
|
|
10432
|
+
isMut: true,
|
|
10433
|
+
isSigner: false,
|
|
10434
|
+
isOptional: true,
|
|
10435
|
+
},
|
|
10436
|
+
{
|
|
10437
|
+
name: 'compressOrDecompressTokenAccount',
|
|
10438
|
+
isMut: true,
|
|
10439
|
+
isSigner: false,
|
|
10440
|
+
isOptional: true,
|
|
10441
|
+
},
|
|
10442
|
+
{
|
|
10443
|
+
name: 'tokenProgram',
|
|
10444
|
+
isMut: false,
|
|
10445
|
+
isSigner: false,
|
|
10446
|
+
isOptional: true,
|
|
10447
|
+
},
|
|
10448
|
+
{
|
|
10449
|
+
name: 'systemProgram',
|
|
10450
|
+
isMut: false,
|
|
10451
|
+
isSigner: false,
|
|
10452
|
+
},
|
|
10453
|
+
],
|
|
10454
|
+
args: [
|
|
10455
|
+
{
|
|
10456
|
+
name: 'owner',
|
|
10457
|
+
type: 'publicKey',
|
|
10458
|
+
},
|
|
10459
|
+
{
|
|
10460
|
+
name: 'remainingAmount',
|
|
10461
|
+
type: {
|
|
10462
|
+
option: 'u64',
|
|
10463
|
+
},
|
|
10464
|
+
},
|
|
10465
|
+
{
|
|
10466
|
+
name: 'cpiContext',
|
|
10467
|
+
type: {
|
|
10468
|
+
option: {
|
|
10469
|
+
defined: 'CompressedCpiContext',
|
|
10470
|
+
},
|
|
10471
|
+
},
|
|
10472
|
+
},
|
|
10473
|
+
],
|
|
10474
|
+
},
|
|
10375
10475
|
{
|
|
10376
10476
|
name: 'transfer',
|
|
10377
10477
|
docs: [
|
|
@@ -12653,7 +12753,7 @@ async function getCompressedTokenAccountsByOwnerOrDelegate(rpc, ownerOrDelegate,
|
|
|
12653
12753
|
res.result.value.items.map(item => {
|
|
12654
12754
|
const _account = item.account;
|
|
12655
12755
|
const _tokenData = item.tokenData;
|
|
12656
|
-
const compressedAccount = createCompressedAccountWithMerkleContext(createMerkleContext(_account.tree, mockNullifierQueue, _account.hash.toArray('be', 32), _account.leafIndex),
|
|
12756
|
+
const compressedAccount = createCompressedAccountWithMerkleContext(createMerkleContext(_account.tree, mockNullifierQueue, _account.hash.toArray('be', 32), _account.leafIndex), _account.owner, bn(_account.lamports), _account.data ? parseAccountData(_account.data) : undefined, _account.address || undefined);
|
|
12657
12757
|
const parsed = {
|
|
12658
12758
|
mint: _tokenData.mint,
|
|
12659
12759
|
owner: _tokenData.owner,
|
|
@@ -13258,6 +13358,9 @@ class Rpc extends Connection {
|
|
|
13258
13358
|
}
|
|
13259
13359
|
return res.result;
|
|
13260
13360
|
}
|
|
13361
|
+
/**
|
|
13362
|
+
* Fetch all the compressed token holders for a given mint. Paginated.
|
|
13363
|
+
*/
|
|
13261
13364
|
async getCompressedMintTokenHolders(mint, options) {
|
|
13262
13365
|
const unsafeRes = await rpcRequest(this.compressionApiEndpoint, 'getCompressedMintTokenHolders', {
|
|
13263
13366
|
mint: mint.toBase58(),
|