@whetstone-research/doppler-sdk 1.0.38 → 1.0.40

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.
@@ -1901,6 +1901,9 @@ function isCosignerGateEnforced(hookPayload, clock = {}) {
1901
1901
  var INITIALIZER_PROGRAM_ID = address(
1902
1902
  "4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1"
1903
1903
  );
1904
+ var MAINNET_INITIALIZER_PROGRAM_ID = address(
1905
+ "4carc9eePfE7jKUXdCAYMhcPf4awEFpZPrz1sTykdss1"
1906
+ );
1904
1907
  var BPF_LOADER_UPGRADEABLE_PROGRAM_ID = address(
1905
1908
  "BPFLoaderUpgradeab1e11111111111111111111111"
1906
1909
  );
@@ -3427,6 +3430,7 @@ __export(initializer_exports, {
3427
3430
  INITIALIZER_ACCOUNT_DISCRIMINATORS: () => INITIALIZER_ACCOUNT_DISCRIMINATORS,
3428
3431
  INITIALIZER_INSTRUCTION_DISCRIMINATORS: () => INITIALIZER_INSTRUCTION_DISCRIMINATORS,
3429
3432
  INITIALIZER_PROGRAM_ID: () => INITIALIZER_PROGRAM_ID,
3433
+ MAINNET_INITIALIZER_PROGRAM_ID: () => MAINNET_INITIALIZER_PROGRAM_ID,
3430
3434
  MAX_HOOK_ALLOWLIST: () => MAX_HOOK_ALLOWLIST2,
3431
3435
  MAX_MIGRATOR_ALLOWLIST: () => MAX_MIGRATOR_ALLOWLIST,
3432
3436
  MAX_PAYLOAD: () => MAX_PAYLOAD,
@@ -6899,7 +6903,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
6899
6903
  keys.push({ address: programId, role: AccountRole.READONLY });
6900
6904
  keys.push({ address: programId, role: AccountRole.READONLY });
6901
6905
  }
6902
- if (programId === INITIALIZER_PROGRAM_ID || vestingConfig) {
6906
+ if (programId === INITIALIZER_PROGRAM_ID || programId === MAINNET_INITIALIZER_PROGRAM_ID || vestingConfig) {
6903
6907
  keys.push(
6904
6908
  vestingConfig ? { address: vestingConfig, role: AccountRole.READONLY } : { address: programId, role: AccountRole.READONLY }
6905
6909
  );
@@ -9288,7 +9292,7 @@ function getRehypeStateEncoder() {
9288
9292
  ["beneficiaryCount", getU8Encoder()],
9289
9293
  ["inflightKind", getU8Encoder()],
9290
9294
  ["inflightDirection", getU8Encoder()],
9291
- ["settlementAuthority", getAddressEncoder()],
9295
+ ["reservedSettlementAuthority", fixEncoderSize(getBytesEncoder(), 32)],
9292
9296
  ["cumulativeRoutedBaseFees", getU64Encoder()],
9293
9297
  ["cumulativeRoutedQuoteFees", getU64Encoder()],
9294
9298
  ["settledInitializerBaseFees", getU64Encoder()],
@@ -9335,7 +9339,7 @@ function getRehypeStateDecoder() {
9335
9339
  ["beneficiaryCount", getU8Decoder()],
9336
9340
  ["inflightKind", getU8Decoder()],
9337
9341
  ["inflightDirection", getU8Decoder()],
9338
- ["settlementAuthority", getAddressDecoder()],
9342
+ ["reservedSettlementAuthority", fixDecoderSize(getBytesDecoder(), 32)],
9339
9343
  ["cumulativeRoutedBaseFees", getU64Decoder()],
9340
9344
  ["cumulativeRoutedQuoteFees", getU64Decoder()],
9341
9345
  ["settledInitializerBaseFees", getU64Decoder()],
@@ -9792,10 +9796,6 @@ async function getInitializeRehypeInstructionAsync(input, config) {
9792
9796
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
9793
9797
  const originalAccounts = {
9794
9798
  payer: { value: input.payer ?? null, isWritable: true },
9795
- settlementAuthority: {
9796
- value: input.settlementAuthority ?? null,
9797
- isWritable: false
9798
- },
9799
9799
  baseMint: { value: input.baseMint ?? null, isWritable: false },
9800
9800
  quoteMint: { value: input.quoteMint ?? null, isWritable: false },
9801
9801
  hookProgram: { value: input.hookProgram ?? null, isWritable: false },
@@ -9922,7 +9922,6 @@ async function getInitializeRehypeInstructionAsync(input, config) {
9922
9922
  return Object.freeze({
9923
9923
  accounts: [
9924
9924
  getAccountMeta("payer", accounts.payer),
9925
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
9926
9925
  getAccountMeta("baseMint", accounts.baseMint),
9927
9926
  getAccountMeta("quoteMint", accounts.quoteMint),
9928
9927
  getAccountMeta("hookProgram", accounts.hookProgram),
@@ -9942,10 +9941,6 @@ function getInitializeRehypeInstruction(input, config) {
9942
9941
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
9943
9942
  const originalAccounts = {
9944
9943
  payer: { value: input.payer ?? null, isWritable: true },
9945
- settlementAuthority: {
9946
- value: input.settlementAuthority ?? null,
9947
- isWritable: false
9948
- },
9949
9944
  baseMint: { value: input.baseMint ?? null, isWritable: false },
9950
9945
  quoteMint: { value: input.quoteMint ?? null, isWritable: false },
9951
9946
  hookProgram: { value: input.hookProgram ?? null, isWritable: false },
@@ -9976,7 +9971,6 @@ function getInitializeRehypeInstruction(input, config) {
9976
9971
  return Object.freeze({
9977
9972
  accounts: [
9978
9973
  getAccountMeta("payer", accounts.payer),
9979
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
9980
9974
  getAccountMeta("baseMint", accounts.baseMint),
9981
9975
  getAccountMeta("quoteMint", accounts.quoteMint),
9982
9976
  getAccountMeta("hookProgram", accounts.hookProgram),
@@ -9993,12 +9987,12 @@ function getInitializeRehypeInstruction(input, config) {
9993
9987
  });
9994
9988
  }
9995
9989
  function parseInitializeRehypeInstruction(instruction) {
9996
- if (instruction.accounts.length < 10) {
9990
+ if (instruction.accounts.length < 9) {
9997
9991
  throw new SolanaError(
9998
9992
  SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
9999
9993
  {
10000
9994
  actualAccountMetas: instruction.accounts.length,
10001
- expectedAccountMetas: 10
9995
+ expectedAccountMetas: 9
10002
9996
  }
10003
9997
  );
10004
9998
  }
@@ -10012,7 +10006,6 @@ function parseInitializeRehypeInstruction(instruction) {
10012
10006
  programAddress: instruction.programAddress,
10013
10007
  accounts: {
10014
10008
  payer: getNextAccount(),
10015
- settlementAuthority: getNextAccount(),
10016
10009
  baseMint: getNextAccount(),
10017
10010
  quoteMint: getNextAccount(),
10018
10011
  hookProgram: getNextAccount(),
@@ -10207,10 +10200,7 @@ function getSettleFeesInstructionDataCodec() {
10207
10200
  async function getSettleFeesInstructionAsync(input, config) {
10208
10201
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
10209
10202
  const originalAccounts = {
10210
- settlementAuthority: {
10211
- value: input.settlementAuthority ?? null,
10212
- isWritable: true
10213
- },
10203
+ payer: { value: input.payer ?? null, isWritable: true },
10214
10204
  initializerProgram: {
10215
10205
  value: input.initializerProgram ?? null,
10216
10206
  isWritable: false
@@ -10428,7 +10418,7 @@ async function getSettleFeesInstructionAsync(input, config) {
10428
10418
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
10429
10419
  return Object.freeze({
10430
10420
  accounts: [
10431
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
10421
+ getAccountMeta("payer", accounts.payer),
10432
10422
  getAccountMeta("initializerProgram", accounts.initializerProgram),
10433
10423
  getAccountMeta("initializerConfig", accounts.initializerConfig),
10434
10424
  getAccountMeta("launch", accounts.launch),
@@ -10465,10 +10455,7 @@ async function getSettleFeesInstructionAsync(input, config) {
10465
10455
  function getSettleFeesInstruction(input, config) {
10466
10456
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
10467
10457
  const originalAccounts = {
10468
- settlementAuthority: {
10469
- value: input.settlementAuthority ?? null,
10470
- isWritable: true
10471
- },
10458
+ payer: { value: input.payer ?? null, isWritable: true },
10472
10459
  initializerProgram: {
10473
10460
  value: input.initializerProgram ?? null,
10474
10461
  isWritable: false
@@ -10540,7 +10527,7 @@ function getSettleFeesInstruction(input, config) {
10540
10527
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
10541
10528
  return Object.freeze({
10542
10529
  accounts: [
10543
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
10530
+ getAccountMeta("payer", accounts.payer),
10544
10531
  getAccountMeta("initializerProgram", accounts.initializerProgram),
10545
10532
  getAccountMeta("initializerConfig", accounts.initializerConfig),
10546
10533
  getAccountMeta("launch", accounts.launch),
@@ -10597,7 +10584,7 @@ function parseSettleFeesInstruction(instruction) {
10597
10584
  return {
10598
10585
  programAddress: instruction.programAddress,
10599
10586
  accounts: {
10600
- settlementAuthority: getNextAccount(),
10587
+ payer: getNextAccount(),
10601
10588
  initializerProgram: getNextAccount(),
10602
10589
  initializerConfig: getNextAccount(),
10603
10590
  launch: getNextAccount(),
@@ -10676,10 +10663,7 @@ function getSettleMigratedFeesInstructionDataCodec() {
10676
10663
  async function getSettleMigratedFeesInstructionAsync(input, config) {
10677
10664
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
10678
10665
  const originalAccounts = {
10679
- settlementAuthority: {
10680
- value: input.settlementAuthority ?? null,
10681
- isWritable: true
10682
- },
10666
+ payer: { value: input.payer ?? null, isWritable: true },
10683
10667
  initializerProgram: {
10684
10668
  value: input.initializerProgram ?? null,
10685
10669
  isWritable: false
@@ -10872,7 +10856,7 @@ async function getSettleMigratedFeesInstructionAsync(input, config) {
10872
10856
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
10873
10857
  return Object.freeze({
10874
10858
  accounts: [
10875
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
10859
+ getAccountMeta("payer", accounts.payer),
10876
10860
  getAccountMeta("initializerProgram", accounts.initializerProgram),
10877
10861
  getAccountMeta("initializerConfig", accounts.initializerConfig),
10878
10862
  getAccountMeta("launch", accounts.launch),
@@ -10912,10 +10896,7 @@ async function getSettleMigratedFeesInstructionAsync(input, config) {
10912
10896
  function getSettleMigratedFeesInstruction(input, config) {
10913
10897
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
10914
10898
  const originalAccounts = {
10915
- settlementAuthority: {
10916
- value: input.settlementAuthority ?? null,
10917
- isWritable: true
10918
- },
10899
+ payer: { value: input.payer ?? null, isWritable: true },
10919
10900
  initializerProgram: {
10920
10901
  value: input.initializerProgram ?? null,
10921
10902
  isWritable: false
@@ -10996,7 +10977,7 @@ function getSettleMigratedFeesInstruction(input, config) {
10996
10977
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
10997
10978
  return Object.freeze({
10998
10979
  accounts: [
10999
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
10980
+ getAccountMeta("payer", accounts.payer),
11000
10981
  getAccountMeta("initializerProgram", accounts.initializerProgram),
11001
10982
  getAccountMeta("initializerConfig", accounts.initializerConfig),
11002
10983
  getAccountMeta("launch", accounts.launch),
@@ -11056,7 +11037,7 @@ function parseSettleMigratedFeesInstruction(instruction) {
11056
11037
  return {
11057
11038
  programAddress: instruction.programAddress,
11058
11039
  accounts: {
11059
- settlementAuthority: getNextAccount(),
11040
+ payer: getNextAccount(),
11060
11041
  initializerProgram: getNextAccount(),
11061
11042
  initializerConfig: getNextAccount(),
11062
11043
  launch: getNextAccount(),
@@ -11321,11 +11302,17 @@ function dopplerRehypeRouterV1Program() {
11321
11302
  ),
11322
11303
  settleFees: (input) => addSelfPlanAndSendFunctions(
11323
11304
  client,
11324
- getSettleFeesInstructionAsync(input)
11305
+ getSettleFeesInstructionAsync({
11306
+ ...input,
11307
+ payer: input.payer ?? client.payer
11308
+ })
11325
11309
  ),
11326
11310
  settleMigratedFees: (input) => addSelfPlanAndSendFunctions(
11327
11311
  client,
11328
- getSettleMigratedFeesInstructionAsync(input)
11312
+ getSettleMigratedFeesInstructionAsync({
11313
+ ...input,
11314
+ payer: input.payer ?? client.payer
11315
+ })
11329
11316
  )
11330
11317
  }
11331
11318
  }
@@ -11946,7 +11933,7 @@ var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
11946
11933
  };
11947
11934
  var DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES = {
11948
11935
  cpmmProgram: address("5pXzd9UiWrVxATCYWmgo5EbfxzXqHYhfSKGdCPXPz7vK"),
11949
- initializerProgram: address("4carc9eePfE7jKUXdCAYMhcPf4awEFpZPrz1sTykdss1"),
11936
+ initializerProgram: MAINNET_INITIALIZER_PROGRAM_ID,
11950
11937
  cpmmMigratorProgram: address(
11951
11938
  "H71WD4tsiCCipro4urykWHySH1ryvLTmqEdNbHTGwb3o"
11952
11939
  ),
@@ -11959,6 +11946,15 @@ var DOPPLER_SOLANA_DEVNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES = {
11959
11946
  dopplerLaunchHookV2Program: DOPPLER_LAUNCH_HOOK_V2_PROGRAM_ID,
11960
11947
  dopplerRehypeRouterV1Program: DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS
11961
11948
  };
11949
+ var DOPPLER_SOLANA_MAINNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES = {
11950
+ initializerProgram: MAINNET_INITIALIZER_PROGRAM_ID,
11951
+ dopplerLaunchHookV2Program: address(
11952
+ "7ZueM1Tef2QA5zrFtVJMDM8MFqkoeG8fog1mXPgmLGH1"
11953
+ ),
11954
+ dopplerRehypeRouterV1Program: address(
11955
+ "BpHX6orJ73qCvsfKkSMARQtqJvSPfqXNUfoes5rMND1D"
11956
+ )
11957
+ };
11962
11958
  async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
11963
11959
  const [cpmmConfig] = await getConfigAddress(programs.cpmmProgram);
11964
11960
  const [initializerConfig] = await getConfigAddress2(
@@ -13572,7 +13568,6 @@ async function prepareLaunch(input) {
13572
13568
  namespace,
13573
13569
  launchId,
13574
13570
  buybackDestination: input.buybackDestination,
13575
- settlementAuthority: input.settlementAuthority,
13576
13571
  routingMode: input.strategy.routingMode,
13577
13572
  feeRouting: input.strategy.feeRouting,
13578
13573
  beneficiaries
@@ -13723,7 +13718,7 @@ async function prepareSettlement(input) {
13723
13718
  ))[0] : void 0;
13724
13719
  const feeState = feeStateAccount.data;
13725
13720
  const routingState = routingStateAccount.data;
13726
- if (feeState.launch !== input.launch || feeState.beneficiaryLen !== 1 || feeState.beneficiaries[0]?.wallet !== routingAddresses.authority || feeState.beneficiaries[0]?.shareBps !== 1e4 || routingState.launch !== input.launch || routingState.baseMint !== launch.baseMint || routingState.quoteMint !== launch.quoteMint || routingState.hookProgram !== launch.hookProgram || routingState.settlementAuthority !== input.settlementAuthority.address || baseMintAccount.address !== launch.baseMint || quoteMintAccount.address !== launch.quoteMint || baseVaultAccount.address !== launch.baseVault || quoteVaultAccount.address !== launch.quoteVault || baseVaultAccount.programAddress !== baseTokenProgram || quoteVaultAccount.programAddress !== quoteTokenProgram || baseVaultAccount.data.mint !== launch.baseMint || quoteVaultAccount.data.mint !== launch.quoteMint || baseVaultAccount.data.owner !== launchAuthority || quoteVaultAccount.data.owner !== launchAuthority) {
13721
+ if (feeState.launch !== input.launch || feeState.beneficiaryLen !== 1 || feeState.beneficiaries[0]?.wallet !== routingAddresses.authority || feeState.beneficiaries[0]?.shareBps !== 1e4 || routingState.launch !== input.launch || routingState.baseMint !== launch.baseMint || routingState.quoteMint !== launch.quoteMint || routingState.hookProgram !== launch.hookProgram || baseMintAccount.address !== launch.baseMint || quoteMintAccount.address !== launch.quoteMint || baseVaultAccount.address !== launch.baseVault || quoteVaultAccount.address !== launch.quoteVault || baseVaultAccount.programAddress !== baseTokenProgram || quoteVaultAccount.programAddress !== quoteTokenProgram || baseVaultAccount.data.mint !== launch.baseMint || quoteVaultAccount.data.mint !== launch.quoteMint || baseVaultAccount.data.owner !== launchAuthority || quoteVaultAccount.data.owner !== launchAuthority) {
13727
13722
  throw new Error("fee rehypothecation state does not match the launch");
13728
13723
  }
13729
13724
  if (routingState.pendingCrossBase !== 0n || routingState.pendingCrossQuote !== 0n || routingState.pendingLpBase !== 0n || routingState.pendingLpQuote !== 0n || routingState.inflightKind !== 0 || routingState.inflightAmountIn !== 0n || routingState.inflightExpectedAmountOut !== 0n) {
@@ -13830,7 +13825,7 @@ async function prepareSettlement(input) {
13830
13825
  });
13831
13826
  const instruction = await getSettleFeesInstructionAsync(
13832
13827
  {
13833
- settlementAuthority: input.settlementAuthority,
13828
+ payer: input.payer,
13834
13829
  initializerProgram: deployment.initializerProgram,
13835
13830
  initializerConfig: deployment.initializerConfig,
13836
13831
  launch: input.launch,
@@ -15249,6 +15244,6 @@ async function assertMigrationQuoteThreshold({
15249
15244
  return progress;
15250
15245
  }
15251
15246
 
15252
- export { DOPPLER_SOLANA_DEVNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES, DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES, DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES, assertMigrationQuoteThreshold, cpmm_exports as cpmm, cpmmMigrator_exports as cpmmMigrator, createLaunch, curveSwapExactIn, deriveSolanaCpmmDeployment, deriveSolanaFeeRehypothecationDeployment, dopplerLaunchHookV1_exports as dopplerLaunchHookV1, dopplerLaunchHookV2_exports as dopplerLaunchHookV2, dopplerRehypeRouterV1_exports as dopplerRehypeRouterV1, feeRehypothecation_exports as feeRehypothecation, getMigrationQuoteProgress, initializer_exports as initializer, migrateLaunch, predictionMigrator_exports as predictionMigrator, swapExactIn, trustedOracle_exports as trustedOracle, vesting_exports as vesting };
15247
+ export { DOPPLER_SOLANA_DEVNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES, DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES, DOPPLER_SOLANA_MAINNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES, DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES, assertMigrationQuoteThreshold, cpmm_exports as cpmm, cpmmMigrator_exports as cpmmMigrator, createLaunch, curveSwapExactIn, deriveSolanaCpmmDeployment, deriveSolanaFeeRehypothecationDeployment, dopplerLaunchHookV1_exports as dopplerLaunchHookV1, dopplerLaunchHookV2_exports as dopplerLaunchHookV2, dopplerRehypeRouterV1_exports as dopplerRehypeRouterV1, feeRehypothecation_exports as feeRehypothecation, getMigrationQuoteProgress, initializer_exports as initializer, migrateLaunch, predictionMigrator_exports as predictionMigrator, swapExactIn, trustedOracle_exports as trustedOracle, vesting_exports as vesting };
15253
15248
  //# sourceMappingURL=index.js.map
15254
15249
  //# sourceMappingURL=index.js.map