@solana/token-acl-gate-sdk 0.2.0 → 0.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 +267 -75
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +248 -75
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/generated/accounts/listConfig.d.ts +2 -1
- package/dist/types/generated/accounts/listConfig.d.ts.map +1 -1
- package/dist/types/generated/accounts/walletEntry.d.ts +2 -1
- package/dist/types/generated/accounts/walletEntry.d.ts.map +1 -1
- package/dist/types/generated/instructions/addWallet.d.ts +1 -12
- package/dist/types/generated/instructions/addWallet.d.ts.map +1 -1
- package/dist/types/generated/instructions/canFreezePermissionless.d.ts +52 -0
- package/dist/types/generated/instructions/canFreezePermissionless.d.ts.map +1 -0
- package/dist/types/generated/instructions/canThawPermissionless.d.ts +57 -0
- package/dist/types/generated/instructions/canThawPermissionless.d.ts.map +1 -0
- package/dist/types/generated/instructions/createList.d.ts +1 -12
- package/dist/types/generated/instructions/createList.d.ts.map +1 -1
- package/dist/types/generated/instructions/deleteList.d.ts +1 -1
- package/dist/types/generated/instructions/deleteList.d.ts.map +1 -1
- package/dist/types/generated/instructions/index.d.ts +3 -0
- package/dist/types/generated/instructions/index.d.ts.map +1 -1
- package/dist/types/generated/instructions/removeWallet.d.ts +1 -1
- package/dist/types/generated/instructions/removeWallet.d.ts.map +1 -1
- package/dist/types/generated/instructions/setupExtraMetas.d.ts +6 -2
- package/dist/types/generated/instructions/setupExtraMetas.d.ts.map +1 -1
- package/dist/types/generated/instructions/setupFreezeExtraMetas.d.ts +52 -0
- package/dist/types/generated/instructions/setupFreezeExtraMetas.d.ts.map +1 -0
- package/dist/types/generated/programs/tokenAclGateProgram.d.ts +12 -3
- package/dist/types/generated/programs/tokenAclGateProgram.d.ts.map +1 -1
- package/dist/types/generated/types/mode.d.ts +1 -1
- package/dist/types/generated/types/mode.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/src/index.js
CHANGED
|
@@ -44,7 +44,10 @@ function getListConfigEncoder() {
|
|
|
44
44
|
["mode", kit.getU8Encoder()],
|
|
45
45
|
["walletsCount", kit.getU64Encoder()]
|
|
46
46
|
]),
|
|
47
|
-
(value) => ({
|
|
47
|
+
(value) => ({
|
|
48
|
+
...value,
|
|
49
|
+
discriminator: value.discriminator ?? LIST_CONFIG_DISCRIMINATOR
|
|
50
|
+
})
|
|
48
51
|
);
|
|
49
52
|
}
|
|
50
53
|
function getListConfigDecoder() {
|
|
@@ -107,7 +110,10 @@ function getWalletEntryEncoder() {
|
|
|
107
110
|
["walletAddress", kit.getAddressEncoder()],
|
|
108
111
|
["listConfig", kit.getAddressEncoder()]
|
|
109
112
|
]),
|
|
110
|
-
(value) => ({
|
|
113
|
+
(value) => ({
|
|
114
|
+
...value,
|
|
115
|
+
discriminator: value.discriminator ?? WALLET_ENTRY_DISCRIMINATOR
|
|
116
|
+
})
|
|
111
117
|
);
|
|
112
118
|
}
|
|
113
119
|
function getWalletEntryDecoder() {
|
|
@@ -172,7 +178,7 @@ function identifyTokenAclGateProgramAccount(account) {
|
|
|
172
178
|
return 1 /* WalletEntry */;
|
|
173
179
|
}
|
|
174
180
|
throw new Error(
|
|
175
|
-
"The provided account could not be identified as a
|
|
181
|
+
"The provided account could not be identified as a tokenAclGateProgram account."
|
|
176
182
|
);
|
|
177
183
|
}
|
|
178
184
|
var TokenAclGateProgramInstruction = /* @__PURE__ */ ((TokenAclGateProgramInstruction2) => {
|
|
@@ -181,6 +187,9 @@ var TokenAclGateProgramInstruction = /* @__PURE__ */ ((TokenAclGateProgramInstru
|
|
|
181
187
|
TokenAclGateProgramInstruction2[TokenAclGateProgramInstruction2["RemoveWallet"] = 2] = "RemoveWallet";
|
|
182
188
|
TokenAclGateProgramInstruction2[TokenAclGateProgramInstruction2["SetupExtraMetas"] = 3] = "SetupExtraMetas";
|
|
183
189
|
TokenAclGateProgramInstruction2[TokenAclGateProgramInstruction2["DeleteList"] = 4] = "DeleteList";
|
|
190
|
+
TokenAclGateProgramInstruction2[TokenAclGateProgramInstruction2["SetupFreezeExtraMetas"] = 5] = "SetupFreezeExtraMetas";
|
|
191
|
+
TokenAclGateProgramInstruction2[TokenAclGateProgramInstruction2["CanThawPermissionless"] = 6] = "CanThawPermissionless";
|
|
192
|
+
TokenAclGateProgramInstruction2[TokenAclGateProgramInstruction2["CanFreezePermissionless"] = 7] = "CanFreezePermissionless";
|
|
184
193
|
return TokenAclGateProgramInstruction2;
|
|
185
194
|
})(TokenAclGateProgramInstruction || {});
|
|
186
195
|
function identifyTokenAclGateProgramInstruction(instruction) {
|
|
@@ -200,16 +209,19 @@ function identifyTokenAclGateProgramInstruction(instruction) {
|
|
|
200
209
|
if (kit.containsBytes(data, kit.getU8Encoder().encode(5), 0)) {
|
|
201
210
|
return 4 /* DeleteList */;
|
|
202
211
|
}
|
|
212
|
+
if (kit.containsBytes(data, kit.getU8Encoder().encode(6), 0)) {
|
|
213
|
+
return 5 /* SetupFreezeExtraMetas */;
|
|
214
|
+
}
|
|
215
|
+
if (kit.containsBytes(data, kit.getU8Encoder().encode(8), 0)) {
|
|
216
|
+
return 6 /* CanThawPermissionless */;
|
|
217
|
+
}
|
|
218
|
+
if (kit.containsBytes(data, kit.getU8Encoder().encode(214), 0)) {
|
|
219
|
+
return 7 /* CanFreezePermissionless */;
|
|
220
|
+
}
|
|
203
221
|
throw new Error(
|
|
204
|
-
"The provided instruction could not be identified as a
|
|
222
|
+
"The provided instruction could not be identified as a tokenAclGateProgram instruction."
|
|
205
223
|
);
|
|
206
224
|
}
|
|
207
|
-
function expectSome(value) {
|
|
208
|
-
if (value === null || value === void 0) {
|
|
209
|
-
throw new Error("Expected a value but received null or undefined.");
|
|
210
|
-
}
|
|
211
|
-
return value;
|
|
212
|
-
}
|
|
213
225
|
function expectAddress(value) {
|
|
214
226
|
if (!value) {
|
|
215
227
|
throw new Error("Expected a Address.");
|
|
@@ -262,7 +274,7 @@ function getAddWalletInstructionDataCodec() {
|
|
|
262
274
|
getAddWalletInstructionDataDecoder()
|
|
263
275
|
);
|
|
264
276
|
}
|
|
265
|
-
|
|
277
|
+
function getAddWalletInstruction(input, config) {
|
|
266
278
|
const programAddress = config?.programAddress ?? TOKEN_ACL_GATE_PROGRAM_PROGRAM_ADDRESS;
|
|
267
279
|
const originalAccounts = {
|
|
268
280
|
authority: { value: input.authority ?? null, isWritable: false },
|
|
@@ -273,12 +285,6 @@ async function getAddWalletInstructionAsync(input, config) {
|
|
|
273
285
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
274
286
|
};
|
|
275
287
|
const accounts = originalAccounts;
|
|
276
|
-
if (!accounts.walletEntry.value) {
|
|
277
|
-
accounts.walletEntry.value = await findWalletEntryPda({
|
|
278
|
-
listConfig: expectAddress(accounts.listConfig.value),
|
|
279
|
-
wallet: expectAddress(accounts.wallet.value)
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
288
|
if (!accounts.systemProgram.value) {
|
|
283
289
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
284
290
|
}
|
|
@@ -296,35 +302,155 @@ async function getAddWalletInstructionAsync(input, config) {
|
|
|
296
302
|
programAddress
|
|
297
303
|
});
|
|
298
304
|
}
|
|
299
|
-
function
|
|
305
|
+
function parseAddWalletInstruction(instruction) {
|
|
306
|
+
if (instruction.accounts.length < 6) {
|
|
307
|
+
throw new Error("Not enough accounts");
|
|
308
|
+
}
|
|
309
|
+
let accountIndex = 0;
|
|
310
|
+
const getNextAccount = () => {
|
|
311
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
312
|
+
accountIndex += 1;
|
|
313
|
+
return accountMeta;
|
|
314
|
+
};
|
|
315
|
+
return {
|
|
316
|
+
programAddress: instruction.programAddress,
|
|
317
|
+
accounts: {
|
|
318
|
+
authority: getNextAccount(),
|
|
319
|
+
payer: getNextAccount(),
|
|
320
|
+
listConfig: getNextAccount(),
|
|
321
|
+
wallet: getNextAccount(),
|
|
322
|
+
walletEntry: getNextAccount(),
|
|
323
|
+
systemProgram: getNextAccount()
|
|
324
|
+
},
|
|
325
|
+
data: getAddWalletInstructionDataDecoder().decode(instruction.data)
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
var CAN_FREEZE_PERMISSIONLESS_DISCRIMINATOR = 214;
|
|
329
|
+
function getCanFreezePermissionlessDiscriminatorBytes() {
|
|
330
|
+
return kit.getU8Encoder().encode(CAN_FREEZE_PERMISSIONLESS_DISCRIMINATOR);
|
|
331
|
+
}
|
|
332
|
+
function getCanFreezePermissionlessInstructionDataEncoder() {
|
|
333
|
+
return kit.transformEncoder(
|
|
334
|
+
kit.getStructEncoder([["discriminator", kit.getU8Encoder()]]),
|
|
335
|
+
(value) => ({
|
|
336
|
+
...value,
|
|
337
|
+
discriminator: CAN_FREEZE_PERMISSIONLESS_DISCRIMINATOR
|
|
338
|
+
})
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
function getCanFreezePermissionlessInstructionDataDecoder() {
|
|
342
|
+
return kit.getStructDecoder([["discriminator", kit.getU8Decoder()]]);
|
|
343
|
+
}
|
|
344
|
+
function getCanFreezePermissionlessInstructionDataCodec() {
|
|
345
|
+
return kit.combineCodec(
|
|
346
|
+
getCanFreezePermissionlessInstructionDataEncoder(),
|
|
347
|
+
getCanFreezePermissionlessInstructionDataDecoder()
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
function getCanFreezePermissionlessInstruction(input, config) {
|
|
300
351
|
const programAddress = config?.programAddress ?? TOKEN_ACL_GATE_PROGRAM_PROGRAM_ADDRESS;
|
|
301
352
|
const originalAccounts = {
|
|
302
353
|
authority: { value: input.authority ?? null, isWritable: false },
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
354
|
+
tokenAccount: { value: input.tokenAccount ?? null, isWritable: false },
|
|
355
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
356
|
+
owner: { value: input.owner ?? null, isWritable: false },
|
|
357
|
+
flagAccount: { value: input.flagAccount ?? null, isWritable: false },
|
|
358
|
+
extraMetas: { value: input.extraMetas ?? null, isWritable: false }
|
|
308
359
|
};
|
|
309
360
|
const accounts = originalAccounts;
|
|
310
|
-
|
|
311
|
-
|
|
361
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
362
|
+
return Object.freeze({
|
|
363
|
+
accounts: [
|
|
364
|
+
getAccountMeta(accounts.authority),
|
|
365
|
+
getAccountMeta(accounts.tokenAccount),
|
|
366
|
+
getAccountMeta(accounts.mint),
|
|
367
|
+
getAccountMeta(accounts.owner),
|
|
368
|
+
getAccountMeta(accounts.flagAccount),
|
|
369
|
+
getAccountMeta(accounts.extraMetas)
|
|
370
|
+
],
|
|
371
|
+
data: getCanFreezePermissionlessInstructionDataEncoder().encode({}),
|
|
372
|
+
programAddress
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function parseCanFreezePermissionlessInstruction(instruction) {
|
|
376
|
+
if (instruction.accounts.length < 6) {
|
|
377
|
+
throw new Error("Not enough accounts");
|
|
312
378
|
}
|
|
379
|
+
let accountIndex = 0;
|
|
380
|
+
const getNextAccount = () => {
|
|
381
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
382
|
+
accountIndex += 1;
|
|
383
|
+
return accountMeta;
|
|
384
|
+
};
|
|
385
|
+
return {
|
|
386
|
+
programAddress: instruction.programAddress,
|
|
387
|
+
accounts: {
|
|
388
|
+
authority: getNextAccount(),
|
|
389
|
+
tokenAccount: getNextAccount(),
|
|
390
|
+
mint: getNextAccount(),
|
|
391
|
+
owner: getNextAccount(),
|
|
392
|
+
flagAccount: getNextAccount(),
|
|
393
|
+
extraMetas: getNextAccount()
|
|
394
|
+
},
|
|
395
|
+
data: getCanFreezePermissionlessInstructionDataDecoder().decode(
|
|
396
|
+
instruction.data
|
|
397
|
+
)
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
var CAN_THAW_PERMISSIONLESS_DISCRIMINATOR = 8;
|
|
401
|
+
function getCanThawPermissionlessDiscriminatorBytes() {
|
|
402
|
+
return kit.getU8Encoder().encode(CAN_THAW_PERMISSIONLESS_DISCRIMINATOR);
|
|
403
|
+
}
|
|
404
|
+
function getCanThawPermissionlessInstructionDataEncoder() {
|
|
405
|
+
return kit.transformEncoder(
|
|
406
|
+
kit.getStructEncoder([["discriminator", kit.getU8Encoder()]]),
|
|
407
|
+
(value) => ({
|
|
408
|
+
...value,
|
|
409
|
+
discriminator: CAN_THAW_PERMISSIONLESS_DISCRIMINATOR
|
|
410
|
+
})
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
function getCanThawPermissionlessInstructionDataDecoder() {
|
|
414
|
+
return kit.getStructDecoder([["discriminator", kit.getU8Decoder()]]);
|
|
415
|
+
}
|
|
416
|
+
function getCanThawPermissionlessInstructionDataCodec() {
|
|
417
|
+
return kit.combineCodec(
|
|
418
|
+
getCanThawPermissionlessInstructionDataEncoder(),
|
|
419
|
+
getCanThawPermissionlessInstructionDataDecoder()
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
function getCanThawPermissionlessInstruction(input, config) {
|
|
423
|
+
const programAddress = config?.programAddress ?? TOKEN_ACL_GATE_PROGRAM_PROGRAM_ADDRESS;
|
|
424
|
+
const originalAccounts = {
|
|
425
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
426
|
+
tokenAccount: { value: input.tokenAccount ?? null, isWritable: false },
|
|
427
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
428
|
+
owner: { value: input.owner ?? null, isWritable: false },
|
|
429
|
+
flagAccount: { value: input.flagAccount ?? null, isWritable: false },
|
|
430
|
+
extraMetas: { value: input.extraMetas ?? null, isWritable: false }
|
|
431
|
+
};
|
|
432
|
+
const accounts = originalAccounts;
|
|
433
|
+
const args = { ...input };
|
|
434
|
+
const remainingAccounts = args.addresses.map((address) => ({
|
|
435
|
+
address,
|
|
436
|
+
role: kit.AccountRole.READONLY
|
|
437
|
+
}));
|
|
313
438
|
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
314
439
|
return Object.freeze({
|
|
315
440
|
accounts: [
|
|
316
441
|
getAccountMeta(accounts.authority),
|
|
317
|
-
getAccountMeta(accounts.
|
|
318
|
-
getAccountMeta(accounts.
|
|
319
|
-
getAccountMeta(accounts.
|
|
320
|
-
getAccountMeta(accounts.
|
|
321
|
-
getAccountMeta(accounts.
|
|
442
|
+
getAccountMeta(accounts.tokenAccount),
|
|
443
|
+
getAccountMeta(accounts.mint),
|
|
444
|
+
getAccountMeta(accounts.owner),
|
|
445
|
+
getAccountMeta(accounts.flagAccount),
|
|
446
|
+
getAccountMeta(accounts.extraMetas),
|
|
447
|
+
...remainingAccounts
|
|
322
448
|
],
|
|
323
|
-
data:
|
|
449
|
+
data: getCanThawPermissionlessInstructionDataEncoder().encode({}),
|
|
324
450
|
programAddress
|
|
325
451
|
});
|
|
326
452
|
}
|
|
327
|
-
function
|
|
453
|
+
function parseCanThawPermissionlessInstruction(instruction) {
|
|
328
454
|
if (instruction.accounts.length < 6) {
|
|
329
455
|
throw new Error("Not enough accounts");
|
|
330
456
|
}
|
|
@@ -338,18 +464,20 @@ function parseAddWalletInstruction(instruction) {
|
|
|
338
464
|
programAddress: instruction.programAddress,
|
|
339
465
|
accounts: {
|
|
340
466
|
authority: getNextAccount(),
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
467
|
+
tokenAccount: getNextAccount(),
|
|
468
|
+
mint: getNextAccount(),
|
|
469
|
+
owner: getNextAccount(),
|
|
470
|
+
flagAccount: getNextAccount(),
|
|
471
|
+
extraMetas: getNextAccount()
|
|
346
472
|
},
|
|
347
|
-
data:
|
|
473
|
+
data: getCanThawPermissionlessInstructionDataDecoder().decode(
|
|
474
|
+
instruction.data
|
|
475
|
+
)
|
|
348
476
|
};
|
|
349
477
|
}
|
|
350
478
|
var Mode = /* @__PURE__ */ ((Mode2) => {
|
|
351
479
|
Mode2[Mode2["Allow"] = 0] = "Allow";
|
|
352
|
-
Mode2[Mode2["
|
|
480
|
+
Mode2[Mode2["Unused"] = 1] = "Unused";
|
|
353
481
|
Mode2[Mode2["Block"] = 2] = "Block";
|
|
354
482
|
return Mode2;
|
|
355
483
|
})(Mode || {});
|
|
@@ -391,39 +519,6 @@ function getCreateListInstructionDataCodec() {
|
|
|
391
519
|
getCreateListInstructionDataDecoder()
|
|
392
520
|
);
|
|
393
521
|
}
|
|
394
|
-
async function getCreateListInstructionAsync(input, config) {
|
|
395
|
-
const programAddress = config?.programAddress ?? TOKEN_ACL_GATE_PROGRAM_PROGRAM_ADDRESS;
|
|
396
|
-
const originalAccounts = {
|
|
397
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
398
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
399
|
-
listConfig: { value: input.listConfig ?? null, isWritable: true },
|
|
400
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
401
|
-
};
|
|
402
|
-
const accounts = originalAccounts;
|
|
403
|
-
const args = { ...input };
|
|
404
|
-
if (!accounts.listConfig.value) {
|
|
405
|
-
accounts.listConfig.value = await findListConfigPda({
|
|
406
|
-
authority: expectAddress(accounts.authority.value),
|
|
407
|
-
seed: expectSome(args.seed)
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
if (!accounts.systemProgram.value) {
|
|
411
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
412
|
-
}
|
|
413
|
-
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
414
|
-
return Object.freeze({
|
|
415
|
-
accounts: [
|
|
416
|
-
getAccountMeta(accounts.authority),
|
|
417
|
-
getAccountMeta(accounts.payer),
|
|
418
|
-
getAccountMeta(accounts.listConfig),
|
|
419
|
-
getAccountMeta(accounts.systemProgram)
|
|
420
|
-
],
|
|
421
|
-
data: getCreateListInstructionDataEncoder().encode(
|
|
422
|
-
args
|
|
423
|
-
),
|
|
424
|
-
programAddress
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
522
|
function getCreateListInstruction(input, config) {
|
|
428
523
|
const programAddress = config?.programAddress ?? TOKEN_ACL_GATE_PROGRAM_PROGRAM_ADDRESS;
|
|
429
524
|
const originalAccounts = {
|
|
@@ -619,7 +714,7 @@ function getSetupExtraMetasInstruction(input, config) {
|
|
|
619
714
|
if (!accounts.systemProgram.value) {
|
|
620
715
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
621
716
|
}
|
|
622
|
-
const remainingAccounts = args.
|
|
717
|
+
const remainingAccounts = args.addresses.map((address) => ({
|
|
623
718
|
address,
|
|
624
719
|
role: kit.AccountRole.READONLY
|
|
625
720
|
}));
|
|
@@ -661,14 +756,95 @@ function parseSetupExtraMetasInstruction(instruction) {
|
|
|
661
756
|
data: getSetupExtraMetasInstructionDataDecoder().decode(instruction.data)
|
|
662
757
|
};
|
|
663
758
|
}
|
|
759
|
+
var SETUP_FREEZE_EXTRA_METAS_DISCRIMINATOR = 6;
|
|
760
|
+
function getSetupFreezeExtraMetasDiscriminatorBytes() {
|
|
761
|
+
return kit.getU8Encoder().encode(SETUP_FREEZE_EXTRA_METAS_DISCRIMINATOR);
|
|
762
|
+
}
|
|
763
|
+
function getSetupFreezeExtraMetasInstructionDataEncoder() {
|
|
764
|
+
return kit.transformEncoder(
|
|
765
|
+
kit.getStructEncoder([["discriminator", kit.getU8Encoder()]]),
|
|
766
|
+
(value) => ({
|
|
767
|
+
...value,
|
|
768
|
+
discriminator: SETUP_FREEZE_EXTRA_METAS_DISCRIMINATOR
|
|
769
|
+
})
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
function getSetupFreezeExtraMetasInstructionDataDecoder() {
|
|
773
|
+
return kit.getStructDecoder([["discriminator", kit.getU8Decoder()]]);
|
|
774
|
+
}
|
|
775
|
+
function getSetupFreezeExtraMetasInstructionDataCodec() {
|
|
776
|
+
return kit.combineCodec(
|
|
777
|
+
getSetupFreezeExtraMetasInstructionDataEncoder(),
|
|
778
|
+
getSetupFreezeExtraMetasInstructionDataDecoder()
|
|
779
|
+
);
|
|
780
|
+
}
|
|
781
|
+
function getSetupFreezeExtraMetasInstruction(input, config) {
|
|
782
|
+
const programAddress = config?.programAddress ?? TOKEN_ACL_GATE_PROGRAM_PROGRAM_ADDRESS;
|
|
783
|
+
const originalAccounts = {
|
|
784
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
785
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
786
|
+
tokenAclMintConfig: {
|
|
787
|
+
value: input.tokenAclMintConfig ?? null,
|
|
788
|
+
isWritable: false
|
|
789
|
+
},
|
|
790
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
791
|
+
extraMetas: { value: input.extraMetas ?? null, isWritable: true },
|
|
792
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
793
|
+
};
|
|
794
|
+
const accounts = originalAccounts;
|
|
795
|
+
if (!accounts.systemProgram.value) {
|
|
796
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
797
|
+
}
|
|
798
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
799
|
+
return Object.freeze({
|
|
800
|
+
accounts: [
|
|
801
|
+
getAccountMeta(accounts.authority),
|
|
802
|
+
getAccountMeta(accounts.payer),
|
|
803
|
+
getAccountMeta(accounts.tokenAclMintConfig),
|
|
804
|
+
getAccountMeta(accounts.mint),
|
|
805
|
+
getAccountMeta(accounts.extraMetas),
|
|
806
|
+
getAccountMeta(accounts.systemProgram)
|
|
807
|
+
],
|
|
808
|
+
data: getSetupFreezeExtraMetasInstructionDataEncoder().encode({}),
|
|
809
|
+
programAddress
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
function parseSetupFreezeExtraMetasInstruction(instruction) {
|
|
813
|
+
if (instruction.accounts.length < 6) {
|
|
814
|
+
throw new Error("Not enough accounts");
|
|
815
|
+
}
|
|
816
|
+
let accountIndex = 0;
|
|
817
|
+
const getNextAccount = () => {
|
|
818
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
819
|
+
accountIndex += 1;
|
|
820
|
+
return accountMeta;
|
|
821
|
+
};
|
|
822
|
+
return {
|
|
823
|
+
programAddress: instruction.programAddress,
|
|
824
|
+
accounts: {
|
|
825
|
+
authority: getNextAccount(),
|
|
826
|
+
payer: getNextAccount(),
|
|
827
|
+
tokenAclMintConfig: getNextAccount(),
|
|
828
|
+
mint: getNextAccount(),
|
|
829
|
+
extraMetas: getNextAccount(),
|
|
830
|
+
systemProgram: getNextAccount()
|
|
831
|
+
},
|
|
832
|
+
data: getSetupFreezeExtraMetasInstructionDataDecoder().decode(
|
|
833
|
+
instruction.data
|
|
834
|
+
)
|
|
835
|
+
};
|
|
836
|
+
}
|
|
664
837
|
|
|
665
838
|
exports.ADD_WALLET_DISCRIMINATOR = ADD_WALLET_DISCRIMINATOR;
|
|
839
|
+
exports.CAN_FREEZE_PERMISSIONLESS_DISCRIMINATOR = CAN_FREEZE_PERMISSIONLESS_DISCRIMINATOR;
|
|
840
|
+
exports.CAN_THAW_PERMISSIONLESS_DISCRIMINATOR = CAN_THAW_PERMISSIONLESS_DISCRIMINATOR;
|
|
666
841
|
exports.CREATE_LIST_DISCRIMINATOR = CREATE_LIST_DISCRIMINATOR;
|
|
667
842
|
exports.DELETE_LIST_DISCRIMINATOR = DELETE_LIST_DISCRIMINATOR;
|
|
668
843
|
exports.LIST_CONFIG_DISCRIMINATOR = LIST_CONFIG_DISCRIMINATOR;
|
|
669
844
|
exports.Mode = Mode;
|
|
670
845
|
exports.REMOVE_WALLET_DISCRIMINATOR = REMOVE_WALLET_DISCRIMINATOR;
|
|
671
846
|
exports.SETUP_EXTRA_METAS_DISCRIMINATOR = SETUP_EXTRA_METAS_DISCRIMINATOR;
|
|
847
|
+
exports.SETUP_FREEZE_EXTRA_METAS_DISCRIMINATOR = SETUP_FREEZE_EXTRA_METAS_DISCRIMINATOR;
|
|
672
848
|
exports.TOKEN_ACL_GATE_PROGRAM_PROGRAM_ADDRESS = TOKEN_ACL_GATE_PROGRAM_PROGRAM_ADDRESS;
|
|
673
849
|
exports.TokenAclGateProgramAccount = TokenAclGateProgramAccount;
|
|
674
850
|
exports.TokenAclGateProgramInstruction = TokenAclGateProgramInstruction;
|
|
@@ -691,13 +867,21 @@ exports.findListConfigPda = findListConfigPda;
|
|
|
691
867
|
exports.findWalletEntryPda = findWalletEntryPda;
|
|
692
868
|
exports.getAddWalletDiscriminatorBytes = getAddWalletDiscriminatorBytes;
|
|
693
869
|
exports.getAddWalletInstruction = getAddWalletInstruction;
|
|
694
|
-
exports.getAddWalletInstructionAsync = getAddWalletInstructionAsync;
|
|
695
870
|
exports.getAddWalletInstructionDataCodec = getAddWalletInstructionDataCodec;
|
|
696
871
|
exports.getAddWalletInstructionDataDecoder = getAddWalletInstructionDataDecoder;
|
|
697
872
|
exports.getAddWalletInstructionDataEncoder = getAddWalletInstructionDataEncoder;
|
|
873
|
+
exports.getCanFreezePermissionlessDiscriminatorBytes = getCanFreezePermissionlessDiscriminatorBytes;
|
|
874
|
+
exports.getCanFreezePermissionlessInstruction = getCanFreezePermissionlessInstruction;
|
|
875
|
+
exports.getCanFreezePermissionlessInstructionDataCodec = getCanFreezePermissionlessInstructionDataCodec;
|
|
876
|
+
exports.getCanFreezePermissionlessInstructionDataDecoder = getCanFreezePermissionlessInstructionDataDecoder;
|
|
877
|
+
exports.getCanFreezePermissionlessInstructionDataEncoder = getCanFreezePermissionlessInstructionDataEncoder;
|
|
878
|
+
exports.getCanThawPermissionlessDiscriminatorBytes = getCanThawPermissionlessDiscriminatorBytes;
|
|
879
|
+
exports.getCanThawPermissionlessInstruction = getCanThawPermissionlessInstruction;
|
|
880
|
+
exports.getCanThawPermissionlessInstructionDataCodec = getCanThawPermissionlessInstructionDataCodec;
|
|
881
|
+
exports.getCanThawPermissionlessInstructionDataDecoder = getCanThawPermissionlessInstructionDataDecoder;
|
|
882
|
+
exports.getCanThawPermissionlessInstructionDataEncoder = getCanThawPermissionlessInstructionDataEncoder;
|
|
698
883
|
exports.getCreateListDiscriminatorBytes = getCreateListDiscriminatorBytes;
|
|
699
884
|
exports.getCreateListInstruction = getCreateListInstruction;
|
|
700
|
-
exports.getCreateListInstructionAsync = getCreateListInstructionAsync;
|
|
701
885
|
exports.getCreateListInstructionDataCodec = getCreateListInstructionDataCodec;
|
|
702
886
|
exports.getCreateListInstructionDataDecoder = getCreateListInstructionDataDecoder;
|
|
703
887
|
exports.getCreateListInstructionDataEncoder = getCreateListInstructionDataEncoder;
|
|
@@ -724,6 +908,11 @@ exports.getSetupExtraMetasInstruction = getSetupExtraMetasInstruction;
|
|
|
724
908
|
exports.getSetupExtraMetasInstructionDataCodec = getSetupExtraMetasInstructionDataCodec;
|
|
725
909
|
exports.getSetupExtraMetasInstructionDataDecoder = getSetupExtraMetasInstructionDataDecoder;
|
|
726
910
|
exports.getSetupExtraMetasInstructionDataEncoder = getSetupExtraMetasInstructionDataEncoder;
|
|
911
|
+
exports.getSetupFreezeExtraMetasDiscriminatorBytes = getSetupFreezeExtraMetasDiscriminatorBytes;
|
|
912
|
+
exports.getSetupFreezeExtraMetasInstruction = getSetupFreezeExtraMetasInstruction;
|
|
913
|
+
exports.getSetupFreezeExtraMetasInstructionDataCodec = getSetupFreezeExtraMetasInstructionDataCodec;
|
|
914
|
+
exports.getSetupFreezeExtraMetasInstructionDataDecoder = getSetupFreezeExtraMetasInstructionDataDecoder;
|
|
915
|
+
exports.getSetupFreezeExtraMetasInstructionDataEncoder = getSetupFreezeExtraMetasInstructionDataEncoder;
|
|
727
916
|
exports.getWalletEntryCodec = getWalletEntryCodec;
|
|
728
917
|
exports.getWalletEntryDecoder = getWalletEntryDecoder;
|
|
729
918
|
exports.getWalletEntryDiscriminatorBytes = getWalletEntryDiscriminatorBytes;
|
|
@@ -732,9 +921,12 @@ exports.getWalletEntrySize = getWalletEntrySize;
|
|
|
732
921
|
exports.identifyTokenAclGateProgramAccount = identifyTokenAclGateProgramAccount;
|
|
733
922
|
exports.identifyTokenAclGateProgramInstruction = identifyTokenAclGateProgramInstruction;
|
|
734
923
|
exports.parseAddWalletInstruction = parseAddWalletInstruction;
|
|
924
|
+
exports.parseCanFreezePermissionlessInstruction = parseCanFreezePermissionlessInstruction;
|
|
925
|
+
exports.parseCanThawPermissionlessInstruction = parseCanThawPermissionlessInstruction;
|
|
735
926
|
exports.parseCreateListInstruction = parseCreateListInstruction;
|
|
736
927
|
exports.parseDeleteListInstruction = parseDeleteListInstruction;
|
|
737
928
|
exports.parseRemoveWalletInstruction = parseRemoveWalletInstruction;
|
|
738
929
|
exports.parseSetupExtraMetasInstruction = parseSetupExtraMetasInstruction;
|
|
930
|
+
exports.parseSetupFreezeExtraMetasInstruction = parseSetupFreezeExtraMetasInstruction;
|
|
739
931
|
//# sourceMappingURL=index.js.map
|
|
740
932
|
//# sourceMappingURL=index.js.map
|