proof-of-take-sdk 1.0.0 → 2.1.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.
Files changed (34) hide show
  1. package/dist/getters/index.d.ts +0 -1
  2. package/dist/getters/index.js +0 -1
  3. package/dist/idl/proof_of_take.json +54 -458
  4. package/dist/instructions/claimReferralPenaltyForWindow.d.ts +2 -1
  5. package/dist/instructions/claimReferralPenaltyForWindow.js +4 -4
  6. package/dist/instructions/claimWindowRewards.d.ts +2 -1
  7. package/dist/instructions/claimWindowRewards.js +2 -2
  8. package/dist/instructions/confirmedPostOnX.d.ts +3 -1
  9. package/dist/instructions/confirmedPostOnX.js +4 -10
  10. package/dist/instructions/createMiztake.d.ts +3 -2
  11. package/dist/instructions/createMiztake.js +5 -5
  12. package/dist/instructions/joinSeason.d.ts +3 -3
  13. package/dist/instructions/joinSeason.js +9 -20
  14. package/dist/instructions/viewSeasonMembershipStatus.d.ts +2 -2
  15. package/dist/instructions/viewSeasonMembershipStatus.js +3 -3
  16. package/dist/instructions/withdrawSeasonDeposit.d.ts +3 -1
  17. package/dist/instructions/withdrawSeasonDeposit.js +3 -7
  18. package/dist/optimistic/index.d.ts +1 -1
  19. package/dist/optimistic/index.js +2 -1
  20. package/dist/types/proof_of_take.d.ts +43 -447
  21. package/dist/types.d.ts +0 -3
  22. package/dist/utils/accountUpdates.d.ts +34 -6
  23. package/dist/utils/accountUpdates.js +57 -10
  24. package/dist/utils/constants.d.ts +0 -1
  25. package/dist/utils/constants.js +1 -2
  26. package/dist/utils/pdaManager.d.ts +6 -6
  27. package/dist/utils/pdaManager.js +11 -11
  28. package/dist/utils/pdas.d.ts +21 -12
  29. package/dist/utils/pdas.js +36 -20
  30. package/dist/utils/tierPenalty.d.ts +8 -0
  31. package/dist/utils/tierPenalty.js +30 -0
  32. package/package.json +1 -1
  33. package/dist/getters/getTokenVault.d.ts +0 -30
  34. package/dist/getters/getTokenVault.js +0 -56
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTokenVault = getTokenVault;
4
- exports.isVaultInitialized = isVaultInitialized;
5
- exports.getVaultTokenBalance = getVaultTokenBalance;
6
- const spl_token_1 = require("@solana/spl-token");
7
- const anchor_1 = require("@coral-xyz/anchor");
8
- const pdas_1 = require("../utils/pdas");
9
- /**
10
- * Get the token vault account information
11
- *
12
- * @param connection - Solana connection
13
- * @returns Token vault account data
14
- */
15
- async function getTokenVault(connection) {
16
- const [vaultPda] = (0, pdas_1.getTokenVaultPda)();
17
- try {
18
- const vaultAccount = await (0, spl_token_1.getAccount)(connection, vaultPda);
19
- return {
20
- address: vaultPda,
21
- data: {
22
- mint: vaultAccount.mint,
23
- owner: vaultAccount.owner,
24
- amount: new anchor_1.BN(vaultAccount.amount.toString()),
25
- delegate: vaultAccount.delegate,
26
- delegatedAmount: vaultAccount.delegatedAmount,
27
- isInitialized: vaultAccount.isInitialized,
28
- isFrozen: vaultAccount.isFrozen,
29
- isNative: vaultAccount.isNative,
30
- closeAuthority: vaultAccount.closeAuthority,
31
- },
32
- };
33
- }
34
- catch (error) {
35
- throw new Error(`Token vault not found or not initialized: ${error}`);
36
- }
37
- }
38
- /**
39
- * Check if token vault is initialized
40
- */
41
- async function isVaultInitialized(connection) {
42
- try {
43
- await getTokenVault(connection);
44
- return true;
45
- }
46
- catch {
47
- return false;
48
- }
49
- }
50
- /**
51
- * Get vault balance (amount of MIZD tokens in vault)
52
- */
53
- async function getVaultTokenBalance(connection) {
54
- const vault = await getTokenVault(connection);
55
- return vault.data.amount;
56
- }