@whetstone-research/doppler-sdk 1.0.31 → 1.0.32

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.
@@ -5,9 +5,9 @@ var chunk4CI2M2F6_cjs = require('../chunk-4CI2M2F6.cjs');
5
5
  var chunkQ7SFCCGT_cjs = require('../chunk-Q7SFCCGT.cjs');
6
6
  var kit = require('@solana/kit');
7
7
  var programClientCore = require('@solana/program-client-core');
8
+ var system = require('@solana-program/system');
8
9
  var sha3_js = require('@noble/hashes/sha3.js');
9
10
  var token = require('@solana-program/token');
10
- var system = require('@solana-program/system');
11
11
  var sysvars = require('@solana/sysvars');
12
12
  var addressLookupTable = require('@solana-program/address-lookup-table');
13
13
 
@@ -733,32 +733,32 @@ async function fetchConfigWithAddress(rpc, programId = chunk4CI2M2F6_cjs.CPMM_PR
733
733
  return { address: configAddress, account };
734
734
  }
735
735
 
736
- // src/solana/cpmmHook/index.ts
737
- var cpmmHook_exports = {};
738
- chunkQ7SFCCGT_cjs.__export(cpmmHook_exports, {
736
+ // src/solana/dopplerLaunchHookV1/index.ts
737
+ var dopplerLaunchHookV1_exports = {};
738
+ chunkQ7SFCCGT_cjs.__export(dopplerLaunchHookV1_exports, {
739
739
  ADD_COSIGNER_DISCRIMINATOR: () => ADD_COSIGNER_DISCRIMINATOR,
740
740
  COSIGNER_CONFIG_DISCRIMINATOR: () => COSIGNER_CONFIG_DISCRIMINATOR,
741
- CPMM_HOOK_ERROR__ARITHMETIC_OVERFLOW: () => CPMM_HOOK_ERROR__ARITHMETIC_OVERFLOW,
742
- CPMM_HOOK_ERROR__COSIGNER_ALREADY_EXISTS: () => CPMM_HOOK_ERROR__COSIGNER_ALREADY_EXISTS,
743
- CPMM_HOOK_ERROR__COSIGNER_LIST_FULL: () => CPMM_HOOK_ERROR__COSIGNER_LIST_FULL,
744
- CPMM_HOOK_ERROR__COSIGNER_NOT_FOUND: () => CPMM_HOOK_ERROR__COSIGNER_NOT_FOUND,
745
- CPMM_HOOK_ERROR__INVALID_AUTHORITY: () => CPMM_HOOK_ERROR__INVALID_AUTHORITY,
746
- CPMM_HOOK_ERROR__INVALID_CONFIG: () => CPMM_HOOK_ERROR__INVALID_CONFIG,
747
- CPMM_HOOK_ERROR__INVALID_COSIGNER: () => CPMM_HOOK_ERROR__INVALID_COSIGNER,
748
- CPMM_HOOK_ERROR__INVALID_DURATION: () => CPMM_HOOK_ERROR__INVALID_DURATION,
749
- CPMM_HOOK_ERROR__INVALID_FEE: () => CPMM_HOOK_ERROR__INVALID_FEE,
750
- CPMM_HOOK_ERROR__INVALID_INSTRUCTION_DATA: () => CPMM_HOOK_ERROR__INVALID_INSTRUCTION_DATA,
751
- CPMM_HOOK_ERROR__INVALID_SCHEDULE_DATA: () => CPMM_HOOK_ERROR__INVALID_SCHEDULE_DATA,
752
- CPMM_HOOK_PROGRAM_ADDRESS: () => CPMM_HOOK_PROGRAM_ADDRESS,
753
- CPMM_HOOK_PROGRAM_ID: () => CPMM_HOOK_PROGRAM_ID,
754
- CpmmHookAccount: () => CpmmHookAccount,
755
- CpmmHookInstruction: () => CpmmHookInstruction,
756
- DEVNET_CPMM_HOOK_PROGRAM_ID: () => DEVNET_CPMM_HOOK_PROGRAM_ID,
741
+ DEVNET_DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID: () => DEVNET_DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID,
742
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__ARITHMETIC_OVERFLOW: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__ARITHMETIC_OVERFLOW,
743
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_ALREADY_EXISTS: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_ALREADY_EXISTS,
744
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_LIST_FULL: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_LIST_FULL,
745
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_NOT_FOUND: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_NOT_FOUND,
746
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_AUTHORITY: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_AUTHORITY,
747
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_CONFIG: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_CONFIG,
748
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_COSIGNER: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_COSIGNER,
749
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_DURATION: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_DURATION,
750
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_FEE: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_FEE,
751
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_INSTRUCTION_DATA: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_INSTRUCTION_DATA,
752
+ DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_SCHEDULE_DATA: () => DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_SCHEDULE_DATA,
753
+ DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS: () => DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS,
754
+ DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID: () => DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID,
757
755
  DYNAMIC_FEE_SCHEDULE_HEADER_LEN: () => DYNAMIC_FEE_SCHEDULE_HEADER_LEN,
758
756
  DYNAMIC_FEE_SCHEDULE_LEN: () => DYNAMIC_FEE_SCHEDULE_LEN,
759
757
  DYNAMIC_FEE_SCHEDULE_MAGIC: () => DYNAMIC_FEE_SCHEDULE_MAGIC,
760
758
  DYNAMIC_FEE_SCHEDULE_MAX_BPS: () => DYNAMIC_FEE_SCHEDULE_MAX_BPS,
761
759
  DYNAMIC_FEE_SCHEDULE_VERSION: () => DYNAMIC_FEE_SCHEDULE_VERSION,
760
+ DopplerLaunchHookV1Account: () => DopplerLaunchHookV1Account,
761
+ DopplerLaunchHookV1Instruction: () => DopplerLaunchHookV1Instruction,
762
762
  GATE_EXPIRY_DISABLED: () => GATE_EXPIRY_DISABLED,
763
763
  GATE_EXPIRY_HEADER_LEN: () => GATE_EXPIRY_HEADER_LEN,
764
764
  GATE_EXPIRY_PAYLOAD_LEN: () => GATE_EXPIRY_PAYLOAD_LEN,
@@ -768,13 +768,13 @@ chunkQ7SFCCGT_cjs.__export(cpmmHook_exports, {
768
768
  INITIALIZE_CONFIG_DISCRIMINATOR: () => INITIALIZE_CONFIG_DISCRIMINATOR2,
769
769
  MAX_COSIGNERS: () => MAX_COSIGNERS,
770
770
  REMOVE_COSIGNER_DISCRIMINATOR: () => REMOVE_COSIGNER_DISCRIMINATOR,
771
- SEED_CPMM_HOOK_CONFIG: () => SEED_CPMM_HOOK_CONFIG,
771
+ SEED_DOPPLER_LAUNCH_HOOK_V1_CONFIG: () => SEED_DOPPLER_LAUNCH_HOOK_V1_CONFIG,
772
772
  SET_AUTHORITY_DISCRIMINATOR: () => SET_AUTHORITY_DISCRIMINATOR,
773
- cpmmHookProgram: () => cpmmHookProgram,
774
773
  decodeCosignerConfig: () => decodeCosignerConfig,
775
774
  decodeCosignerGateExpiryPayload: () => decodeCosignerGateExpiryPayload,
775
+ dopplerLaunchHookV1Program: () => dopplerLaunchHookV1Program,
776
776
  encodeCosignerGateExpiryPayload: () => encodeCosignerGateExpiryPayload,
777
- encodeCpmmHookPayload: () => encodeCpmmHookPayload,
777
+ encodeDopplerLaunchHookV1Payload: () => encodeDopplerLaunchHookV1Payload,
778
778
  encodeDynamicFeeCosignerGatePayload: () => encodeDynamicFeeCosignerGatePayload,
779
779
  encodeDynamicFeeSchedule: () => encodeDynamicFeeSchedule,
780
780
  fetchAllCosignerConfig: () => fetchAllCosignerConfig,
@@ -796,10 +796,10 @@ chunkQ7SFCCGT_cjs.__export(cpmmHook_exports, {
796
796
  getCosignerConfigEncoder: () => getCosignerConfigEncoder,
797
797
  getCosignerConfigSize: () => getCosignerConfigSize,
798
798
  getCosignerGateStatus: () => getCosignerGateStatus,
799
- getCpmmHookConfigAddress: () => getCpmmHookConfigAddress,
800
- getCpmmHookErrorMessage: () => getCpmmHookErrorMessage,
801
- getCpmmHookRemainingAccountAddresses: () => getCpmmHookRemainingAccountAddresses,
802
- getCpmmHookRemainingAccounts: () => getCpmmHookRemainingAccounts,
799
+ getDopplerLaunchHookV1ConfigAddress: () => getDopplerLaunchHookV1ConfigAddress,
800
+ getDopplerLaunchHookV1ErrorMessage: () => getDopplerLaunchHookV1ErrorMessage,
801
+ getDopplerLaunchHookV1RemainingAccountAddresses: () => getDopplerLaunchHookV1RemainingAccountAddresses,
802
+ getDopplerLaunchHookV1RemainingAccounts: () => getDopplerLaunchHookV1RemainingAccounts,
803
803
  getInitializeConfigArgsCodec: () => getInitializeConfigArgsCodec,
804
804
  getInitializeConfigArgsDecoder: () => getInitializeConfigArgsDecoder,
805
805
  getInitializeConfigArgsEncoder: () => getInitializeConfigArgsEncoder,
@@ -824,16 +824,18 @@ chunkQ7SFCCGT_cjs.__export(cpmmHook_exports, {
824
824
  getSetAuthorityInstructionDataCodec: () => getSetAuthorityInstructionDataCodec,
825
825
  getSetAuthorityInstructionDataDecoder: () => getSetAuthorityInstructionDataDecoder,
826
826
  getSetAuthorityInstructionDataEncoder: () => getSetAuthorityInstructionDataEncoder,
827
- identifyCpmmHookAccount: () => identifyCpmmHookAccount,
828
- identifyCpmmHookInstruction: () => identifyCpmmHookInstruction,
827
+ identifyDopplerLaunchHookV1Account: () => identifyDopplerLaunchHookV1Account,
828
+ identifyDopplerLaunchHookV1Instruction: () => identifyDopplerLaunchHookV1Instruction,
829
829
  isCosignerGateEnforced: () => isCosignerGateEnforced,
830
- isCpmmHookError: () => isCpmmHookError,
830
+ isDopplerLaunchHookV1Error: () => isDopplerLaunchHookV1Error,
831
831
  isDynamicFeeSchedulePayload: () => isDynamicFeeSchedulePayload,
832
+ isResolvedManagedCosignerGate: () => isResolvedManagedCosignerGate,
832
833
  parseAddCosignerInstruction: () => parseAddCosignerInstruction,
833
- parseCpmmHookInstruction: () => parseCpmmHookInstruction,
834
+ parseDopplerLaunchHookV1Instruction: () => parseDopplerLaunchHookV1Instruction,
834
835
  parseInitializeConfigInstruction: () => parseInitializeConfigInstruction2,
835
836
  parseRemoveCosignerInstruction: () => parseRemoveCosignerInstruction,
836
837
  parseSetAuthorityInstruction: () => parseSetAuthorityInstruction,
838
+ resolveManagedCosignerGate: () => resolveManagedCosignerGate,
837
839
  validateDynamicFeeScheduleArgs: () => validateDynamicFeeScheduleArgs
838
840
  });
839
841
  var COSIGNER_CONFIG_DISCRIMINATOR = new Uint8Array([
@@ -885,13 +887,13 @@ function decodeCosignerConfig(encodedAccount) {
885
887
  getCosignerConfigDecoder()
886
888
  );
887
889
  }
888
- async function fetchCosignerConfig(rpc, address7, config) {
889
- const maybeAccount = await fetchMaybeCosignerConfig(rpc, address7, config);
890
+ async function fetchCosignerConfig(rpc, address6, config) {
891
+ const maybeAccount = await fetchMaybeCosignerConfig(rpc, address6, config);
890
892
  kit.assertAccountExists(maybeAccount);
891
893
  return maybeAccount;
892
894
  }
893
- async function fetchMaybeCosignerConfig(rpc, address7, config) {
894
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
895
+ async function fetchMaybeCosignerConfig(rpc, address6, config) {
896
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
895
897
  return decodeCosignerConfig(maybeAccount);
896
898
  }
897
899
  async function fetchAllCosignerConfig(rpc, addresses, config) {
@@ -949,7 +951,7 @@ function getAddCosignerInstructionDataCodec() {
949
951
  );
950
952
  }
951
953
  async function getAddCosignerInstructionAsync(input, config) {
952
- const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
954
+ const programAddress = config?.programAddress ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
953
955
  const originalAccounts = {
954
956
  adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
955
957
  config: { value: input.config ?? null, isWritable: true }
@@ -1000,7 +1002,7 @@ async function getAddCosignerInstructionAsync(input, config) {
1000
1002
  });
1001
1003
  }
1002
1004
  function getAddCosignerInstruction(input, config) {
1003
- const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
1005
+ const programAddress = config?.programAddress ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
1004
1006
  const originalAccounts = {
1005
1007
  adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
1006
1008
  config: { value: input.config ?? null, isWritable: true }
@@ -1078,7 +1080,7 @@ function getInitializeConfigInstructionDataCodec2() {
1078
1080
  );
1079
1081
  }
1080
1082
  async function getInitializeConfigInstructionAsync2(input, config) {
1081
- const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
1083
+ const programAddress = config?.programAddress ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
1082
1084
  const originalAccounts = {
1083
1085
  payer: { value: input.payer ?? null, isWritable: true },
1084
1086
  adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
@@ -1138,7 +1140,7 @@ async function getInitializeConfigInstructionAsync2(input, config) {
1138
1140
  });
1139
1141
  }
1140
1142
  function getInitializeConfigInstruction2(input, config) {
1141
- const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
1143
+ const programAddress = config?.programAddress ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
1142
1144
  const originalAccounts = {
1143
1145
  payer: { value: input.payer ?? null, isWritable: true },
1144
1146
  adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
@@ -1231,7 +1233,7 @@ function getRemoveCosignerInstructionDataCodec() {
1231
1233
  );
1232
1234
  }
1233
1235
  async function getRemoveCosignerInstructionAsync(input, config) {
1234
- const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
1236
+ const programAddress = config?.programAddress ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
1235
1237
  const originalAccounts = {
1236
1238
  adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
1237
1239
  config: { value: input.config ?? null, isWritable: true }
@@ -1282,7 +1284,7 @@ async function getRemoveCosignerInstructionAsync(input, config) {
1282
1284
  });
1283
1285
  }
1284
1286
  function getRemoveCosignerInstruction(input, config) {
1285
- const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
1287
+ const programAddress = config?.programAddress ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
1286
1288
  const originalAccounts = {
1287
1289
  adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
1288
1290
  config: { value: input.config ?? null, isWritable: true }
@@ -1360,7 +1362,7 @@ function getSetAuthorityInstructionDataCodec() {
1360
1362
  );
1361
1363
  }
1362
1364
  async function getSetAuthorityInstructionAsync(input, config) {
1363
- const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
1365
+ const programAddress = config?.programAddress ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
1364
1366
  const originalAccounts = {
1365
1367
  adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
1366
1368
  config: { value: input.config ?? null, isWritable: true }
@@ -1411,7 +1413,7 @@ async function getSetAuthorityInstructionAsync(input, config) {
1411
1413
  });
1412
1414
  }
1413
1415
  function getSetAuthorityInstruction(input, config) {
1414
- const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
1416
+ const programAddress = config?.programAddress ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
1415
1417
  const originalAccounts = {
1416
1418
  adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
1417
1419
  config: { value: input.config ?? null, isWritable: true }
@@ -1453,13 +1455,13 @@ function parseSetAuthorityInstruction(instruction) {
1453
1455
  };
1454
1456
  }
1455
1457
 
1456
- // src/solana/generated/cpmmHook/programs/cpmmHook.ts
1457
- var CPMM_HOOK_PROGRAM_ADDRESS = "HVsPNZh98TgChUXHwKrUG47SUqvGQHxUy5wZwcQLFD4i";
1458
- var CpmmHookAccount = /* @__PURE__ */ ((CpmmHookAccount2) => {
1459
- CpmmHookAccount2[CpmmHookAccount2["CosignerConfig"] = 0] = "CosignerConfig";
1460
- return CpmmHookAccount2;
1461
- })(CpmmHookAccount || {});
1462
- function identifyCpmmHookAccount(account) {
1458
+ // src/solana/generated/dopplerLaunchHookV1/programs/dopplerLaunchHookV1.ts
1459
+ var DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS = "HVsPNZh98TgChUXHwKrUG47SUqvGQHxUy5wZwcQLFD4i";
1460
+ var DopplerLaunchHookV1Account = /* @__PURE__ */ ((DopplerLaunchHookV1Account2) => {
1461
+ DopplerLaunchHookV1Account2[DopplerLaunchHookV1Account2["CosignerConfig"] = 0] = "CosignerConfig";
1462
+ return DopplerLaunchHookV1Account2;
1463
+ })(DopplerLaunchHookV1Account || {});
1464
+ function identifyDopplerLaunchHookV1Account(account) {
1463
1465
  const data = "data" in account ? account.data : account;
1464
1466
  if (kit.containsBytes(
1465
1467
  data,
@@ -1472,17 +1474,17 @@ function identifyCpmmHookAccount(account) {
1472
1474
  }
1473
1475
  throw new kit.SolanaError(
1474
1476
  kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,
1475
- { accountData: data, programName: "cpmmHook" }
1477
+ { accountData: data, programName: "dopplerLaunchHookV1" }
1476
1478
  );
1477
1479
  }
1478
- var CpmmHookInstruction = /* @__PURE__ */ ((CpmmHookInstruction2) => {
1479
- CpmmHookInstruction2[CpmmHookInstruction2["AddCosigner"] = 0] = "AddCosigner";
1480
- CpmmHookInstruction2[CpmmHookInstruction2["InitializeConfig"] = 1] = "InitializeConfig";
1481
- CpmmHookInstruction2[CpmmHookInstruction2["RemoveCosigner"] = 2] = "RemoveCosigner";
1482
- CpmmHookInstruction2[CpmmHookInstruction2["SetAuthority"] = 3] = "SetAuthority";
1483
- return CpmmHookInstruction2;
1484
- })(CpmmHookInstruction || {});
1485
- function identifyCpmmHookInstruction(instruction) {
1480
+ var DopplerLaunchHookV1Instruction = /* @__PURE__ */ ((DopplerLaunchHookV1Instruction2) => {
1481
+ DopplerLaunchHookV1Instruction2[DopplerLaunchHookV1Instruction2["AddCosigner"] = 0] = "AddCosigner";
1482
+ DopplerLaunchHookV1Instruction2[DopplerLaunchHookV1Instruction2["InitializeConfig"] = 1] = "InitializeConfig";
1483
+ DopplerLaunchHookV1Instruction2[DopplerLaunchHookV1Instruction2["RemoveCosigner"] = 2] = "RemoveCosigner";
1484
+ DopplerLaunchHookV1Instruction2[DopplerLaunchHookV1Instruction2["SetAuthority"] = 3] = "SetAuthority";
1485
+ return DopplerLaunchHookV1Instruction2;
1486
+ })(DopplerLaunchHookV1Instruction || {});
1487
+ function identifyDopplerLaunchHookV1Instruction(instruction) {
1486
1488
  const data = "data" in instruction ? instruction.data : instruction;
1487
1489
  if (kit.containsBytes(
1488
1490
  data,
@@ -1522,11 +1524,11 @@ function identifyCpmmHookInstruction(instruction) {
1522
1524
  }
1523
1525
  throw new kit.SolanaError(
1524
1526
  kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,
1525
- { instructionData: data, programName: "cpmmHook" }
1527
+ { instructionData: data, programName: "dopplerLaunchHookV1" }
1526
1528
  );
1527
1529
  }
1528
- function parseCpmmHookInstruction(instruction) {
1529
- const instructionType = identifyCpmmHookInstruction(instruction);
1530
+ function parseDopplerLaunchHookV1Instruction(instruction) {
1531
+ const instructionType = identifyDopplerLaunchHookV1Instruction(instruction);
1530
1532
  switch (instructionType) {
1531
1533
  case 0 /* AddCosigner */: {
1532
1534
  kit.assertIsInstructionWithAccounts(instruction);
@@ -1559,15 +1561,18 @@ function parseCpmmHookInstruction(instruction) {
1559
1561
  default:
1560
1562
  throw new kit.SolanaError(
1561
1563
  kit.SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,
1562
- { instructionType, programName: "cpmmHook" }
1564
+ {
1565
+ instructionType,
1566
+ programName: "dopplerLaunchHookV1"
1567
+ }
1563
1568
  );
1564
1569
  }
1565
1570
  }
1566
- function cpmmHookProgram() {
1571
+ function dopplerLaunchHookV1Program() {
1567
1572
  return (client) => {
1568
1573
  return {
1569
1574
  ...client,
1570
- cpmmHook: {
1575
+ dopplerLaunchHookV1: {
1571
1576
  accounts: {
1572
1577
  cosignerConfig: programClientCore.addSelfFetchFunctions(
1573
1578
  client,
@@ -1600,45 +1605,45 @@ function cpmmHookProgram() {
1600
1605
  };
1601
1606
  }
1602
1607
 
1603
- // src/solana/generated/cpmmHook/errors/cpmmHook.ts
1604
- var CPMM_HOOK_ERROR__INVALID_INSTRUCTION_DATA = 6e3;
1605
- var CPMM_HOOK_ERROR__INVALID_SCHEDULE_DATA = 6001;
1606
- var CPMM_HOOK_ERROR__INVALID_FEE = 6002;
1607
- var CPMM_HOOK_ERROR__INVALID_DURATION = 6003;
1608
- var CPMM_HOOK_ERROR__ARITHMETIC_OVERFLOW = 6004;
1609
- var CPMM_HOOK_ERROR__INVALID_AUTHORITY = 6005;
1610
- var CPMM_HOOK_ERROR__INVALID_CONFIG = 6006;
1611
- var CPMM_HOOK_ERROR__INVALID_COSIGNER = 6007;
1612
- var CPMM_HOOK_ERROR__COSIGNER_ALREADY_EXISTS = 6008;
1613
- var CPMM_HOOK_ERROR__COSIGNER_NOT_FOUND = 6009;
1614
- var CPMM_HOOK_ERROR__COSIGNER_LIST_FULL = 6010;
1615
- var cpmmHookErrorMessages;
1608
+ // src/solana/generated/dopplerLaunchHookV1/errors/dopplerLaunchHookV1.ts
1609
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_INSTRUCTION_DATA = 6e3;
1610
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_SCHEDULE_DATA = 6001;
1611
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_FEE = 6002;
1612
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_DURATION = 6003;
1613
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__ARITHMETIC_OVERFLOW = 6004;
1614
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_AUTHORITY = 6005;
1615
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_CONFIG = 6006;
1616
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_COSIGNER = 6007;
1617
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_ALREADY_EXISTS = 6008;
1618
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_NOT_FOUND = 6009;
1619
+ var DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_LIST_FULL = 6010;
1620
+ var dopplerLaunchHookV1ErrorMessages;
1616
1621
  if (process.env.NODE_ENV !== "production") {
1617
- cpmmHookErrorMessages = {
1618
- [CPMM_HOOK_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic overflow`,
1619
- [CPMM_HOOK_ERROR__COSIGNER_ALREADY_EXISTS]: `Cosigner already exists`,
1620
- [CPMM_HOOK_ERROR__COSIGNER_LIST_FULL]: `Cosigner list is full`,
1621
- [CPMM_HOOK_ERROR__COSIGNER_NOT_FOUND]: `Cosigner not found`,
1622
- [CPMM_HOOK_ERROR__INVALID_AUTHORITY]: `Invalid hook authority`,
1623
- [CPMM_HOOK_ERROR__INVALID_CONFIG]: `Invalid cosigner hook config`,
1624
- [CPMM_HOOK_ERROR__INVALID_COSIGNER]: `Invalid cosigner key`,
1625
- [CPMM_HOOK_ERROR__INVALID_DURATION]: `Invalid fee duration`,
1626
- [CPMM_HOOK_ERROR__INVALID_FEE]: `Invalid fee`,
1627
- [CPMM_HOOK_ERROR__INVALID_INSTRUCTION_DATA]: `Invalid instruction data`,
1628
- [CPMM_HOOK_ERROR__INVALID_SCHEDULE_DATA]: `Invalid schedule payload`
1622
+ dopplerLaunchHookV1ErrorMessages = {
1623
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic overflow`,
1624
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_ALREADY_EXISTS]: `Cosigner already exists`,
1625
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_LIST_FULL]: `Cosigner list is full`,
1626
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__COSIGNER_NOT_FOUND]: `Cosigner not found`,
1627
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_AUTHORITY]: `Invalid hook authority`,
1628
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_CONFIG]: `Invalid cosigner hook config`,
1629
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_COSIGNER]: `Invalid cosigner key`,
1630
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_DURATION]: `Invalid fee duration`,
1631
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_FEE]: `Invalid fee`,
1632
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_INSTRUCTION_DATA]: `Invalid instruction data`,
1633
+ [DOPPLER_LAUNCH_HOOK_V1_ERROR__INVALID_SCHEDULE_DATA]: `Invalid schedule payload`
1629
1634
  };
1630
1635
  }
1631
- function getCpmmHookErrorMessage(code) {
1636
+ function getDopplerLaunchHookV1ErrorMessage(code) {
1632
1637
  if (process.env.NODE_ENV !== "production") {
1633
- return cpmmHookErrorMessages[code];
1638
+ return dopplerLaunchHookV1ErrorMessages[code];
1634
1639
  }
1635
1640
  return "Error message not available in production bundles.";
1636
1641
  }
1637
- function isCpmmHookError(error, transactionMessage, code) {
1642
+ function isDopplerLaunchHookV1Error(error, transactionMessage, code) {
1638
1643
  return kit.isProgramError(
1639
1644
  error,
1640
1645
  transactionMessage,
1641
- CPMM_HOOK_PROGRAM_ADDRESS,
1646
+ DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS,
1642
1647
  code
1643
1648
  );
1644
1649
  }
@@ -1679,11 +1684,11 @@ function getSetAuthorityArgsCodec() {
1679
1684
  getSetAuthorityArgsDecoder()
1680
1685
  );
1681
1686
  }
1682
- var DEVNET_CPMM_HOOK_PROGRAM_ID = kit.address(
1683
- "HVsPNZh98TgChUXHwKrUG47SUqvGQHxUy5wZwcQLFD4i"
1684
- );
1685
- var CPMM_HOOK_PROGRAM_ID = DEVNET_CPMM_HOOK_PROGRAM_ID;
1686
- var SEED_CPMM_HOOK_CONFIG = "cosigner_hook_config";
1687
+
1688
+ // src/solana/dopplerLaunchHookV1/constants.ts
1689
+ var DEVNET_DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID = DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ADDRESS;
1690
+ var DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID = DEVNET_DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID;
1691
+ var SEED_DOPPLER_LAUNCH_HOOK_V1_CONFIG = "cosigner_hook_config";
1687
1692
  var MAX_COSIGNERS = 32;
1688
1693
  var GATE_EXPIRY_DISABLED = 0;
1689
1694
  var GATE_EXPIRY_UNIX_TIMESTAMP = 1;
@@ -1705,6 +1710,66 @@ var DYNAMIC_FEE_SCHEDULE_VERSION = 1;
1705
1710
  var DYNAMIC_FEE_SCHEDULE_LEN = 32;
1706
1711
  var DYNAMIC_FEE_SCHEDULE_HEADER_LEN = 16;
1707
1712
  var DYNAMIC_FEE_SCHEDULE_MAX_BPS = 1e4;
1713
+ var textEncoder2 = new TextEncoder();
1714
+ async function getDopplerLaunchHookV1ConfigAddress(programId = DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID) {
1715
+ return kit.getProgramDerivedAddress({
1716
+ programAddress: programId,
1717
+ seeds: [textEncoder2.encode(SEED_DOPPLER_LAUNCH_HOOK_V1_CONFIG)]
1718
+ });
1719
+ }
1720
+
1721
+ // src/solana/dopplerLaunchHookV1/config.ts
1722
+ var resolvedManagedCosignerGateBrand = Symbol(
1723
+ "resolvedManagedCosignerGate"
1724
+ );
1725
+ function isResolvedManagedCosignerGate(value) {
1726
+ return typeof value === "object" && value !== null && value[resolvedManagedCosignerGateBrand] === true;
1727
+ }
1728
+ async function resolveManagedCosignerGate(rpc, input = {}) {
1729
+ const programId = input.programId ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID;
1730
+ const [config, expectedBump] = await getDopplerLaunchHookV1ConfigAddress(programId);
1731
+ const configAccount = await fetchMaybeCosignerConfig(rpc, config, {
1732
+ commitment: "confirmed"
1733
+ });
1734
+ if (!configAccount.exists) {
1735
+ throw new Error(`Doppler-managed cosigner config ${config} does not exist`);
1736
+ }
1737
+ if (configAccount.programAddress !== programId) {
1738
+ throw new Error(
1739
+ `Doppler-managed cosigner config ${config} is owned by ${configAccount.programAddress}, expected ${programId}`
1740
+ );
1741
+ }
1742
+ const { bump, cosignerCount, cosigners, version } = configAccount.data;
1743
+ if (version !== 1 || bump !== expectedBump || cosignerCount === 0 || cosignerCount > MAX_COSIGNERS || cosignerCount > cosigners.length) {
1744
+ throw new Error(
1745
+ `Doppler-managed cosigner config ${config} has no valid active cosigner`
1746
+ );
1747
+ }
1748
+ const activeCosigners = Object.freeze(cosigners.slice(0, cosignerCount));
1749
+ if (activeCosigners.some((candidate) => candidate === system.SYSTEM_PROGRAM_ADDRESS) || new Set(activeCosigners).size !== activeCosigners.length) {
1750
+ throw new Error(
1751
+ `Doppler-managed cosigner config ${config} contains invalid active cosigners`
1752
+ );
1753
+ }
1754
+ const cosigner = activeCosigners[0];
1755
+ if (!cosigner) {
1756
+ throw new Error(
1757
+ `Doppler-managed cosigner config ${config} has no active cosigner`
1758
+ );
1759
+ }
1760
+ const resolvedGate = {
1761
+ [resolvedManagedCosignerGateBrand]: true,
1762
+ programId,
1763
+ config,
1764
+ cosigner,
1765
+ activeCosigners,
1766
+ ...input.expiresAt !== void 0 ? { expiresAt: input.expiresAt } : {}
1767
+ };
1768
+ Object.defineProperty(resolvedGate, resolvedManagedCosignerGateBrand, {
1769
+ enumerable: false
1770
+ });
1771
+ return Object.freeze(resolvedGate);
1772
+ }
1708
1773
  var MAX_U64 = (1n << 64n) - 1n;
1709
1774
  function toBigInt(value) {
1710
1775
  return typeof value === "bigint" ? value : BigInt(value);
@@ -2030,7 +2095,7 @@ function phaseLabel(phase) {
2030
2095
  }
2031
2096
  }
2032
2097
 
2033
- // src/solana/cpmmHook/payload.ts
2098
+ // src/solana/dopplerLaunchHookV1/payload.ts
2034
2099
  var MAX_I64 = (1n << 63n) - 1n;
2035
2100
  var MAX_U32 = (1n << 32n) - 1n;
2036
2101
  function toBigInt2(value) {
@@ -2083,7 +2148,7 @@ function encodeDynamicFeeSchedule(schedule) {
2083
2148
  writeU32Le(payload, 28, durationSeconds);
2084
2149
  return payload;
2085
2150
  }
2086
- function encodeCpmmHookPayload(args = {}) {
2151
+ function encodeDopplerLaunchHookV1Payload(args = {}) {
2087
2152
  const schedulePayload = args.schedule ? encodeDynamicFeeSchedule(args.schedule) : new Uint8Array();
2088
2153
  const gatePayload = args.gateExpiry ? encodeCosignerGateExpiryPayload(args.gateExpiry) : new Uint8Array();
2089
2154
  const payload = new Uint8Array(schedulePayload.length + gatePayload.length);
@@ -2094,7 +2159,7 @@ function encodeCpmmHookPayload(args = {}) {
2094
2159
  function encodeDynamicFeeCosignerGatePayload(args) {
2095
2160
  return encodeCosignerGateExpiryPayload(args);
2096
2161
  }
2097
- function getCpmmHookRemainingAccounts({
2162
+ function getDopplerLaunchHookV1RemainingAccounts({
2098
2163
  namespace,
2099
2164
  config,
2100
2165
  cosigner
@@ -2117,12 +2182,12 @@ function getCpmmHookRemainingAccounts({
2117
2182
  )
2118
2183
  };
2119
2184
  }
2120
- function getCpmmHookRemainingAccountAddresses({
2185
+ function getDopplerLaunchHookV1RemainingAccountAddresses({
2121
2186
  namespace,
2122
2187
  config,
2123
2188
  cosigner
2124
2189
  }) {
2125
- return getCpmmHookRemainingAccounts({
2190
+ return getDopplerLaunchHookV1RemainingAccounts({
2126
2191
  namespace,
2127
2192
  config,
2128
2193
  cosigner
@@ -2131,13 +2196,6 @@ function getCpmmHookRemainingAccountAddresses({
2131
2196
  function isDynamicFeeSchedulePayload(payload) {
2132
2197
  return payload.length >= DYNAMIC_FEE_SCHEDULE_LEN && DYNAMIC_FEE_SCHEDULE_MAGIC.every((byte, index) => payload[index] === byte);
2133
2198
  }
2134
- var textEncoder2 = new TextEncoder();
2135
- async function getCpmmHookConfigAddress(programId = CPMM_HOOK_PROGRAM_ID) {
2136
- return kit.getProgramDerivedAddress({
2137
- programAddress: programId,
2138
- seeds: [textEncoder2.encode(SEED_CPMM_HOOK_CONFIG)]
2139
- });
2140
- }
2141
2199
 
2142
2200
  // src/solana/initializer/index.ts
2143
2201
  var initializer_exports = {};
@@ -3420,13 +3478,13 @@ function decodeClaimReceipt(encodedAccount) {
3420
3478
  getClaimReceiptDecoder()
3421
3479
  );
3422
3480
  }
3423
- async function fetchClaimReceipt(rpc, address7, config) {
3424
- const maybeAccount = await fetchMaybeClaimReceipt(rpc, address7, config);
3481
+ async function fetchClaimReceipt(rpc, address6, config) {
3482
+ const maybeAccount = await fetchMaybeClaimReceipt(rpc, address6, config);
3425
3483
  kit.assertAccountExists(maybeAccount);
3426
3484
  return maybeAccount;
3427
3485
  }
3428
- async function fetchMaybeClaimReceipt(rpc, address7, config) {
3429
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
3486
+ async function fetchMaybeClaimReceipt(rpc, address6, config) {
3487
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
3430
3488
  return decodeClaimReceipt(maybeAccount);
3431
3489
  }
3432
3490
  async function fetchAllClaimReceipt(rpc, addresses, config) {
@@ -3490,13 +3548,13 @@ function decodeEntry(encodedAccount) {
3490
3548
  getEntryDecoder()
3491
3549
  );
3492
3550
  }
3493
- async function fetchEntry(rpc, address7, config) {
3494
- const maybeAccount = await fetchMaybeEntry(rpc, address7, config);
3551
+ async function fetchEntry(rpc, address6, config) {
3552
+ const maybeAccount = await fetchMaybeEntry(rpc, address6, config);
3495
3553
  kit.assertAccountExists(maybeAccount);
3496
3554
  return maybeAccount;
3497
3555
  }
3498
- async function fetchMaybeEntry(rpc, address7, config) {
3499
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
3556
+ async function fetchMaybeEntry(rpc, address6, config) {
3557
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
3500
3558
  return decodeEntry(maybeAccount);
3501
3559
  }
3502
3560
  async function fetchAllEntry(rpc, addresses, config) {
@@ -3558,13 +3616,13 @@ function decodeEntryByMint(encodedAccount) {
3558
3616
  getEntryByMintDecoder()
3559
3617
  );
3560
3618
  }
3561
- async function fetchEntryByMint(rpc, address7, config) {
3562
- const maybeAccount = await fetchMaybeEntryByMint(rpc, address7, config);
3619
+ async function fetchEntryByMint(rpc, address6, config) {
3620
+ const maybeAccount = await fetchMaybeEntryByMint(rpc, address6, config);
3563
3621
  kit.assertAccountExists(maybeAccount);
3564
3622
  return maybeAccount;
3565
3623
  }
3566
- async function fetchMaybeEntryByMint(rpc, address7, config) {
3567
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
3624
+ async function fetchMaybeEntryByMint(rpc, address6, config) {
3625
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
3568
3626
  return decodeEntryByMint(maybeAccount);
3569
3627
  }
3570
3628
  async function fetchAllEntryByMint(rpc, addresses, config) {
@@ -3645,13 +3703,13 @@ function decodeInitConfig(encodedAccount) {
3645
3703
  getInitConfigDecoder2()
3646
3704
  );
3647
3705
  }
3648
- async function fetchInitConfig(rpc, address7, config) {
3649
- const maybeAccount = await fetchMaybeInitConfig(rpc, address7, config);
3706
+ async function fetchInitConfig(rpc, address6, config) {
3707
+ const maybeAccount = await fetchMaybeInitConfig(rpc, address6, config);
3650
3708
  kit.assertAccountExists(maybeAccount);
3651
3709
  return maybeAccount;
3652
3710
  }
3653
- async function fetchMaybeInitConfig(rpc, address7, config) {
3654
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
3711
+ async function fetchMaybeInitConfig(rpc, address6, config) {
3712
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
3655
3713
  return decodeInitConfig(maybeAccount);
3656
3714
  }
3657
3715
  async function fetchAllInitConfig(rpc, addresses, config) {
@@ -3951,13 +4009,13 @@ function decodeLaunch(encodedAccount) {
3951
4009
  getLaunchDecoder2()
3952
4010
  );
3953
4011
  }
3954
- async function fetchLaunch(rpc, address7, config) {
3955
- const maybeAccount = await fetchMaybeLaunch(rpc, address7, config);
4012
+ async function fetchLaunch(rpc, address6, config) {
4013
+ const maybeAccount = await fetchMaybeLaunch(rpc, address6, config);
3956
4014
  kit.assertAccountExists(maybeAccount);
3957
4015
  return maybeAccount;
3958
4016
  }
3959
- async function fetchMaybeLaunch(rpc, address7, config) {
3960
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
4017
+ async function fetchMaybeLaunch(rpc, address6, config) {
4018
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
3961
4019
  return decodeLaunch(maybeAccount);
3962
4020
  }
3963
4021
  async function fetchAllLaunch(rpc, addresses, config) {
@@ -4031,13 +4089,13 @@ function decodeMarket(encodedAccount) {
4031
4089
  getMarketDecoder()
4032
4090
  );
4033
4091
  }
4034
- async function fetchMarket(rpc, address7, config) {
4035
- const maybeAccount = await fetchMaybeMarket(rpc, address7, config);
4092
+ async function fetchMarket(rpc, address6, config) {
4093
+ const maybeAccount = await fetchMaybeMarket(rpc, address6, config);
4036
4094
  kit.assertAccountExists(maybeAccount);
4037
4095
  return maybeAccount;
4038
4096
  }
4039
- async function fetchMaybeMarket(rpc, address7, config) {
4040
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
4097
+ async function fetchMaybeMarket(rpc, address6, config) {
4098
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
4041
4099
  return decodeMarket(maybeAccount);
4042
4100
  }
4043
4101
  async function fetchAllMarket(rpc, addresses, config) {
@@ -4103,13 +4161,13 @@ function decodeOracleState2(encodedAccount) {
4103
4161
  getOracleStateDecoder()
4104
4162
  );
4105
4163
  }
4106
- async function fetchOracleState(rpc, address7, config) {
4107
- const maybeAccount = await fetchMaybeOracleState(rpc, address7, config);
4164
+ async function fetchOracleState(rpc, address6, config) {
4165
+ const maybeAccount = await fetchMaybeOracleState(rpc, address6, config);
4108
4166
  kit.assertAccountExists(maybeAccount);
4109
4167
  return maybeAccount;
4110
4168
  }
4111
- async function fetchMaybeOracleState(rpc, address7, config) {
4112
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
4169
+ async function fetchMaybeOracleState(rpc, address6, config) {
4170
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
4113
4171
  return decodeOracleState2(maybeAccount);
4114
4172
  }
4115
4173
  async function fetchAllOracleState(rpc, addresses, config) {
@@ -6283,8 +6341,8 @@ async function createSpotPoolInstruction(input) {
6283
6341
  }
6284
6342
 
6285
6343
  // src/solana/migrators/cpmmMigrator/client.ts
6286
- async function fetchCpmmMigratorState(rpc, address7) {
6287
- const response = await rpc.getAccountInfo(address7, { encoding: "base64" }).send();
6344
+ async function fetchCpmmMigratorState(rpc, address6) {
6345
+ const response = await rpc.getAccountInfo(address6, { encoding: "base64" }).send();
6288
6346
  if (!response.value) return null;
6289
6347
  return getCpmmMigratorStateDecoder().decode(
6290
6348
  chunk7PXLEMBJ_cjs.base64ToBytes(response.value.data[0])
@@ -6347,8 +6405,8 @@ async function buildCpmmMigrationRemainingAccounts({
6347
6405
  { address: migrationAuthority, role: kit.AccountRole.READONLY },
6348
6406
  { address: adminBaseAta, role: kit.AccountRole.WRITABLE },
6349
6407
  { address: adminQuoteAta, role: kit.AccountRole.WRITABLE },
6350
- ...recipientAtas.map((address7) => ({
6351
- address: address7,
6408
+ ...recipientAtas.map((address6) => ({
6409
+ address: address6,
6352
6410
  role: kit.AccountRole.WRITABLE
6353
6411
  }))
6354
6412
  ],
@@ -6452,30 +6510,35 @@ function hashRemainingAccounts(accounts) {
6452
6510
  function isCustomMigrationConfig(migration) {
6453
6511
  return migration.kind === "custom";
6454
6512
  }
6455
- async function getCreateLaunchHookContext(input) {
6456
- const program = input.deployment?.cpmmHookProgram ?? CPMM_HOOK_PROGRAM_ID;
6457
- if (input.cosignGateExpiresAt != null && !input.cosigner) {
6458
- throw new Error("cosigner is required when cosignGateExpiresAt is set");
6459
- }
6460
- if (!input.cosigner) {
6513
+ function getCreateLaunchHookContext(input) {
6514
+ const program = input.deployment?.dopplerLaunchHookV1Program ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID;
6515
+ if (!input.cosignerGate) {
6461
6516
  return { program };
6462
6517
  }
6463
- const [config] = await getCpmmHookConfigAddress(program);
6464
- return { program, config };
6518
+ if (!isResolvedManagedCosignerGate(input.cosignerGate)) {
6519
+ throw new Error(
6520
+ "cosignerGate must be returned by dopplerLaunchHookV1.resolveManagedCosignerGate"
6521
+ );
6522
+ }
6523
+ if (input.cosignerGate.programId !== program) {
6524
+ throw new Error(
6525
+ `managed cosigner gate was resolved for ${input.cosignerGate.programId}, expected ${program}`
6526
+ );
6527
+ }
6528
+ return { program, cosignerGate: input.cosignerGate };
6465
6529
  }
6466
- function resolveCpmmHookPayload(input) {
6530
+ function resolveDopplerLaunchHookV1Payload(input, hookContext) {
6467
6531
  let gateExpiry = null;
6468
- if (input.cosignGateExpiresAt !== void 0 && input.cosignGateExpiresAt !== null) {
6469
- if (!input.cosigner) {
6470
- throw new Error("cosigner is required when cosignGateExpiresAt is set");
6471
- }
6532
+ const cosignerGate = hookContext.cosignerGate;
6533
+ const expiresAt = cosignerGate?.expiresAt;
6534
+ if (cosignerGate && expiresAt !== void 0 && expiresAt !== null) {
6472
6535
  gateExpiry = {
6473
6536
  mode: GATE_EXPIRY_UNIX_TIMESTAMP,
6474
- value: input.cosignGateExpiresAt,
6475
- cosigner: getSignerAddress(input.cosigner)
6537
+ value: expiresAt,
6538
+ cosigner: cosignerGate.cosigner
6476
6539
  };
6477
6540
  }
6478
- return encodeCpmmHookPayload({
6541
+ return encodeDopplerLaunchHookV1Payload({
6479
6542
  schedule: input.dynamicFee ?? null,
6480
6543
  gateExpiry
6481
6544
  });
@@ -6485,17 +6548,17 @@ function resolveCreateLaunchHook({
6485
6548
  namespace,
6486
6549
  hookContext
6487
6550
  }) {
6488
- const hasCosigner = Boolean(input.cosigner);
6551
+ const hasCosigner = hookContext.cosignerGate !== void 0;
6489
6552
  const hasSchedule = Boolean(input.dynamicFee);
6490
- const remainingAccounts = getCpmmHookRemainingAccounts({
6553
+ const remainingAccounts = getDopplerLaunchHookV1RemainingAccounts({
6491
6554
  namespace,
6492
- config: hookContext.config,
6493
- cosigner: input.cosigner
6555
+ config: hookContext.cosignerGate?.config,
6556
+ cosigner: hookContext.cosignerGate?.cosigner
6494
6557
  });
6495
6558
  return {
6496
6559
  program: hookContext.program,
6497
6560
  flags: HF_BEFORE_SWAP2 | (hasSchedule ? HF_BEFORE_CREATE : 0) | (hasCosigner ? HF_FORWARD_READONLY_SIGNERS2 : 0),
6498
- payload: resolveCpmmHookPayload(input),
6561
+ payload: resolveDopplerLaunchHookV1Payload(input, hookContext),
6499
6562
  remainingAccountsHash: remainingAccounts.hookRemainingAccountsHash
6500
6563
  };
6501
6564
  }
@@ -6633,7 +6696,7 @@ async function getMigrationInitRemainingAccountsHash({
6633
6696
  async function createLaunch(input) {
6634
6697
  const programId = getInitializerProgramId(input);
6635
6698
  const launchId = input.launchId ?? createLaunchId();
6636
- const hookContext = await getCreateLaunchHookContext(input);
6699
+ const hookContext = getCreateLaunchHookContext(input);
6637
6700
  const namespace = input.namespace ?? chunk4CI2M2F6_cjs.SYSTEM_PROGRAM_ADDRESS;
6638
6701
  const tokenPrograms = {
6639
6702
  ...launchTokenPrograms.splToken(),
@@ -6727,7 +6790,8 @@ async function createLaunch(input) {
6727
6790
  launchId,
6728
6791
  addresses,
6729
6792
  instruction: preparedInstruction,
6730
- cpmmMigration: migration?.cpmmMigration
6793
+ cpmmMigration: migration?.cpmmMigration,
6794
+ ...hookContext.cosignerGate ? { cosignerGate: hookContext.cosignerGate } : {}
6731
6795
  };
6732
6796
  }
6733
6797
  var DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND = 20;
@@ -6835,8 +6899,8 @@ function assertTransactionMessageFitsWithLookupTable(transactionMessage, lookupT
6835
6899
  return assertTransactionMessageFits(compressedMessage, options);
6836
6900
  }
6837
6901
  var addressCodec6 = kit.getAddressCodec();
6838
- async function fetchLaunch2(rpc, address7, config) {
6839
- const response = await rpc.getAccountInfo(address7, {
6902
+ async function fetchLaunch2(rpc, address6, config) {
6903
+ const response = await rpc.getAccountInfo(address6, {
6840
6904
  encoding: "base64",
6841
6905
  commitment: config?.commitment
6842
6906
  }).send();
@@ -7241,13 +7305,13 @@ function decodeOracleState3(encodedAccount) {
7241
7305
  getOracleStateDecoder2()
7242
7306
  );
7243
7307
  }
7244
- async function fetchOracleState2(rpc, address7, config) {
7245
- const maybeAccount = await fetchMaybeOracleState2(rpc, address7, config);
7308
+ async function fetchOracleState2(rpc, address6, config) {
7309
+ const maybeAccount = await fetchMaybeOracleState2(rpc, address6, config);
7246
7310
  kit.assertAccountExists(maybeAccount);
7247
7311
  return maybeAccount;
7248
7312
  }
7249
- async function fetchMaybeOracleState2(rpc, address7, config) {
7250
- const maybeAccount = await kit.fetchEncodedAccount(rpc, address7, config);
7313
+ async function fetchMaybeOracleState2(rpc, address6, config) {
7314
+ const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
7251
7315
  return decodeOracleState3(maybeAccount);
7252
7316
  }
7253
7317
  async function fetchAllOracleState2(rpc, addresses, config) {
@@ -7681,7 +7745,7 @@ async function curveSwapExactIn(input) {
7681
7745
  baseMint: input.baseMint,
7682
7746
  quoteMint: input.quoteMint,
7683
7747
  user,
7684
- hookProgram: input.deployment?.cpmmHookProgram ?? CPMM_HOOK_PROGRAM_ID,
7748
+ hookProgram: input.deployment?.dopplerLaunchHookV1Program ?? DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID,
7685
7749
  baseTokenProgram,
7686
7750
  quoteTokenProgram,
7687
7751
  remainingAccounts: input.remainingAccounts ? [...input.remainingAccounts] : void 0
@@ -7912,7 +7976,7 @@ var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
7912
7976
  cpmmProgram: chunk4CI2M2F6_cjs.CPMM_PROGRAM_ID,
7913
7977
  initializerProgram: INITIALIZER_PROGRAM_ID,
7914
7978
  cpmmMigratorProgram: CPMM_MIGRATOR_PROGRAM_ID,
7915
- cpmmHookProgram: CPMM_HOOK_PROGRAM_ID
7979
+ dopplerLaunchHookV1Program: DOPPLER_LAUNCH_HOOK_V1_PROGRAM_ID
7916
7980
  };
7917
7981
  var DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES = {
7918
7982
  cpmmProgram: kit.address("5pXzd9UiWrVxATCYWmgo5EbfxzXqHYhfSKGdCPXPz7vK"),
@@ -7920,7 +7984,9 @@ var DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES = {
7920
7984
  cpmmMigratorProgram: kit.address(
7921
7985
  "H71WD4tsiCCipro4urykWHySH1ryvLTmqEdNbHTGwb3o"
7922
7986
  ),
7923
- cpmmHookProgram: kit.address("BeyqffXEVgLpM3fQ1zjk8YnZzQN9sMVrCKtNKwSxNATr")
7987
+ dopplerLaunchHookV1Program: kit.address(
7988
+ "BeyqffXEVgLpM3fQ1zjk8YnZzQN9sMVrCKtNKwSxNATr"
7989
+ )
7924
7990
  };
7925
7991
  async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
7926
7992
  const [cpmmConfig] = await chunk4CI2M2F6_cjs.getConfigAddress(programs.cpmmProgram);
@@ -7938,11 +8004,11 @@ exports.DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = DOPPLER_SOLANA_DEVNET_PROGRAM_
7938
8004
  exports.DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES = DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES;
7939
8005
  exports.assertMigrationQuoteThreshold = assertMigrationQuoteThreshold;
7940
8006
  exports.cpmm = cpmm_exports;
7941
- exports.cpmmHook = cpmmHook_exports;
7942
8007
  exports.cpmmMigrator = cpmmMigrator_exports;
7943
8008
  exports.createLaunch = createLaunch;
7944
8009
  exports.curveSwapExactIn = curveSwapExactIn;
7945
8010
  exports.deriveSolanaCpmmDeployment = deriveSolanaCpmmDeployment;
8011
+ exports.dopplerLaunchHookV1 = dopplerLaunchHookV1_exports;
7946
8012
  exports.getMigrationQuoteProgress = getMigrationQuoteProgress;
7947
8013
  exports.initializer = initializer_exports;
7948
8014
  exports.migrateLaunch = migrateLaunch;