@hawksightco/hawk-sdk 1.3.199 → 1.3.201

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 (37) hide show
  1. package/dist/src/addresses.d.ts +0 -3
  2. package/dist/src/addresses.d.ts.map +1 -1
  3. package/dist/src/addresses.js +1 -6
  4. package/dist/src/classes/SimpleIxGenerator.d.ts +0 -7
  5. package/dist/src/classes/SimpleIxGenerator.d.ts.map +1 -1
  6. package/dist/src/classes/SimpleIxGenerator.js +0 -7
  7. package/dist/src/classes/SimplePdaGenerator.d.ts +2 -7
  8. package/dist/src/classes/SimplePdaGenerator.d.ts.map +1 -1
  9. package/dist/src/classes/SimplePdaGenerator.js +2 -7
  10. package/dist/src/classes/Transactions.d.ts +14 -54
  11. package/dist/src/classes/Transactions.d.ts.map +1 -1
  12. package/dist/src/classes/Transactions.js +217 -259
  13. package/dist/src/classes/TxGenerator.d.ts +1 -30
  14. package/dist/src/classes/TxGenerator.d.ts.map +1 -1
  15. package/dist/src/classes/TxGenerator.js +0 -102
  16. package/dist/src/classes/TxGeneratorAutomations.d.ts +15 -29
  17. package/dist/src/classes/TxGeneratorAutomations.d.ts.map +1 -1
  18. package/dist/src/classes/TxGeneratorAutomations.js +52 -84
  19. package/dist/src/functions.js +1 -1
  20. package/dist/src/idl/iyf-extension-idl.d.ts +12 -0
  21. package/dist/src/idl/iyf-extension-idl.d.ts.map +1 -1
  22. package/dist/src/idl/iyf-extension-idl.js +12 -0
  23. package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts +6 -4
  24. package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +1 -1
  25. package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.js +4 -10
  26. package/dist/src/pdaGenerator/MeteoraPdaGenerator.d.ts +0 -13
  27. package/dist/src/pdaGenerator/MeteoraPdaGenerator.d.ts.map +1 -1
  28. package/dist/src/pdaGenerator/MeteoraPdaGenerator.js +0 -26
  29. package/dist/src/types.d.ts +23 -127
  30. package/dist/src/types.d.ts.map +1 -1
  31. package/package.json +1 -1
  32. package/dist/src/ixGenerator/HatchIxGenerator.d.ts +0 -186
  33. package/dist/src/ixGenerator/HatchIxGenerator.d.ts.map +0 -1
  34. package/dist/src/ixGenerator/HatchIxGenerator.js +0 -453
  35. package/dist/src/pdaGenerator/HatchPdaGenerator.d.ts +0 -62
  36. package/dist/src/pdaGenerator/HatchPdaGenerator.d.ts.map +0 -1
  37. package/dist/src/pdaGenerator/HatchPdaGenerator.js +0 -118
@@ -1,62 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- /**
3
- * PDA Generator for the Hatch program.
4
- *
5
- * Derives program-derived addresses for:
6
- * - LauncherPda: Per-launcher PDA that owns positions (and receives fees)
7
- * - LaunchTokenAccount: Per-mint PDA that holds tokens for position creation
8
- *
9
- * Note: LauncherPda is the position owner. Positions are "locked" because
10
- * only the Hatch program can sign for LauncherPda via CPI.
11
- */
12
- export declare class HatchPdaGenerator {
13
- /**
14
- * Derive a LauncherPda for a specific authority.
15
- *
16
- * Seeds: ["launcher", authority]
17
- * Each launcher authority gets their own LauncherPda which:
18
- * - Owns the position (signs for position operations via CPI)
19
- * - Receives trading fees (after protocol fee deduction)
20
- *
21
- * The position is effectively "locked" because only the Hatch program
22
- * can sign for LauncherPda.
23
- *
24
- * @param authority - The launcher authority wallet
25
- * @returns The LauncherPda public key
26
- */
27
- deriveLauncherPda(authority: web3.PublicKey): web3.PublicKey;
28
- /**
29
- * Derive a LaunchTokenAccount PDA for a specific mint and launcher.
30
- *
31
- * Seeds: ["launch-token", token_mint, launcher_pda]
32
- * This PDA holds the tokens that will be deposited into the position
33
- * during pool creation.
34
- *
35
- * @param tokenMint - The token mint address
36
- * @param launcherPda - The launcher PDA (derived from authority)
37
- * @returns The LaunchTokenAccount PDA public key
38
- */
39
- deriveLaunchTokenAccount(tokenMint: web3.PublicKey, launcherPda: web3.PublicKey): web3.PublicKey;
40
- /**
41
- * Derive Metaplex Token Metadata PDA for a mint.
42
- *
43
- * Seeds: ["metadata", token_metadata_program, mint]
44
- * This PDA stores the token metadata (name, symbol, uri).
45
- *
46
- * @param tokenMint - The token mint address
47
- * @returns The metadata PDA public key
48
- */
49
- deriveMetadata(tokenMint: web3.PublicKey): web3.PublicKey;
50
- /**
51
- * Derive position PDA for Meteora DLMM.
52
- *
53
- * Seeds: ["position", lb_pair, base, lower_bin_id (le bytes)]
54
- *
55
- * @param lbPair - The LB pair (pool) address
56
- * @param base - The base keypair public key
57
- * @param lowerBinId - The lower bin ID
58
- * @returns The position PDA public key
59
- */
60
- derivePositionPda(lbPair: web3.PublicKey, base: web3.PublicKey, lowerBinId: number): web3.PublicKey;
61
- }
62
- //# sourceMappingURL=HatchPdaGenerator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HatchPdaGenerator.d.ts","sourceRoot":"","sources":["../../../src/pdaGenerator/HatchPdaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC;;;;;;;;;GASG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS;IAQ5D;;;;;;;;;;OAUG;IACH,wBAAwB,CACtB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,WAAW,EAAE,IAAI,CAAC,SAAS,GAC1B,IAAI,CAAC,SAAS;IAQjB;;;;;;;;OAQG;IACH,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS;IAYzD;;;;;;;;;OASG;IACH,iBAAiB,CACf,MAAM,EAAE,IAAI,CAAC,SAAS,EACtB,IAAI,EAAE,IAAI,CAAC,SAAS,EACpB,UAAU,EAAE,MAAM,GACjB,IAAI,CAAC,SAAS;CAWlB"}
@@ -1,118 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.HatchPdaGenerator = void 0;
37
- const web3 = __importStar(require("@solana/web3.js"));
38
- const addresses_1 = require("../addresses");
39
- /**
40
- * PDA Generator for the Hatch program.
41
- *
42
- * Derives program-derived addresses for:
43
- * - LauncherPda: Per-launcher PDA that owns positions (and receives fees)
44
- * - LaunchTokenAccount: Per-mint PDA that holds tokens for position creation
45
- *
46
- * Note: LauncherPda is the position owner. Positions are "locked" because
47
- * only the Hatch program can sign for LauncherPda via CPI.
48
- */
49
- class HatchPdaGenerator {
50
- /**
51
- * Derive a LauncherPda for a specific authority.
52
- *
53
- * Seeds: ["launcher", authority]
54
- * Each launcher authority gets their own LauncherPda which:
55
- * - Owns the position (signs for position operations via CPI)
56
- * - Receives trading fees (after protocol fee deduction)
57
- *
58
- * The position is effectively "locked" because only the Hatch program
59
- * can sign for LauncherPda.
60
- *
61
- * @param authority - The launcher authority wallet
62
- * @returns The LauncherPda public key
63
- */
64
- deriveLauncherPda(authority) {
65
- const [pda] = web3.PublicKey.findProgramAddressSync([Buffer.from("launcher"), authority.toBuffer()], addresses_1.HATCH_PROGRAM);
66
- return pda;
67
- }
68
- /**
69
- * Derive a LaunchTokenAccount PDA for a specific mint and launcher.
70
- *
71
- * Seeds: ["launch-token", token_mint, launcher_pda]
72
- * This PDA holds the tokens that will be deposited into the position
73
- * during pool creation.
74
- *
75
- * @param tokenMint - The token mint address
76
- * @param launcherPda - The launcher PDA (derived from authority)
77
- * @returns The LaunchTokenAccount PDA public key
78
- */
79
- deriveLaunchTokenAccount(tokenMint, launcherPda) {
80
- const [pda] = web3.PublicKey.findProgramAddressSync([Buffer.from("launch-token"), tokenMint.toBuffer(), launcherPda.toBuffer()], addresses_1.HATCH_PROGRAM);
81
- return pda;
82
- }
83
- /**
84
- * Derive Metaplex Token Metadata PDA for a mint.
85
- *
86
- * Seeds: ["metadata", token_metadata_program, mint]
87
- * This PDA stores the token metadata (name, symbol, uri).
88
- *
89
- * @param tokenMint - The token mint address
90
- * @returns The metadata PDA public key
91
- */
92
- deriveMetadata(tokenMint) {
93
- const [pda] = web3.PublicKey.findProgramAddressSync([
94
- Buffer.from("metadata"),
95
- addresses_1.TOKEN_METADATA_PROGRAM.toBuffer(),
96
- tokenMint.toBuffer(),
97
- ], addresses_1.TOKEN_METADATA_PROGRAM);
98
- return pda;
99
- }
100
- /**
101
- * Derive position PDA for Meteora DLMM.
102
- *
103
- * Seeds: ["position", lb_pair, base, lower_bin_id (le bytes)]
104
- *
105
- * @param lbPair - The LB pair (pool) address
106
- * @param base - The base keypair public key
107
- * @param lowerBinId - The lower bin ID
108
- * @returns The position PDA public key
109
- */
110
- derivePositionPda(lbPair, base, lowerBinId) {
111
- const METEORA_DLMM_PROGRAM = new web3.PublicKey("LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo");
112
- const lowerBinIdBuffer = Buffer.alloc(4);
113
- lowerBinIdBuffer.writeInt32LE(lowerBinId, 0);
114
- const [pda] = web3.PublicKey.findProgramAddressSync([Buffer.from("position"), lbPair.toBuffer(), base.toBuffer(), lowerBinIdBuffer], METEORA_DLMM_PROGRAM);
115
- return pda;
116
- }
117
- }
118
- exports.HatchPdaGenerator = HatchPdaGenerator;