@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.
@@ -1903,6 +1903,9 @@ function isCosignerGateEnforced(hookPayload, clock = {}) {
1903
1903
  var INITIALIZER_PROGRAM_ID = kit.address(
1904
1904
  "4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1"
1905
1905
  );
1906
+ var MAINNET_INITIALIZER_PROGRAM_ID = kit.address(
1907
+ "4carc9eePfE7jKUXdCAYMhcPf4awEFpZPrz1sTykdss1"
1908
+ );
1906
1909
  var BPF_LOADER_UPGRADEABLE_PROGRAM_ID = kit.address(
1907
1910
  "BPFLoaderUpgradeab1e11111111111111111111111"
1908
1911
  );
@@ -3429,6 +3432,7 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
3429
3432
  INITIALIZER_ACCOUNT_DISCRIMINATORS: () => INITIALIZER_ACCOUNT_DISCRIMINATORS,
3430
3433
  INITIALIZER_INSTRUCTION_DISCRIMINATORS: () => INITIALIZER_INSTRUCTION_DISCRIMINATORS,
3431
3434
  INITIALIZER_PROGRAM_ID: () => INITIALIZER_PROGRAM_ID,
3435
+ MAINNET_INITIALIZER_PROGRAM_ID: () => MAINNET_INITIALIZER_PROGRAM_ID,
3432
3436
  MAX_HOOK_ALLOWLIST: () => MAX_HOOK_ALLOWLIST2,
3433
3437
  MAX_MIGRATOR_ALLOWLIST: () => MAX_MIGRATOR_ALLOWLIST,
3434
3438
  MAX_PAYLOAD: () => MAX_PAYLOAD,
@@ -6901,7 +6905,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
6901
6905
  keys.push({ address: programId, role: kit.AccountRole.READONLY });
6902
6906
  keys.push({ address: programId, role: kit.AccountRole.READONLY });
6903
6907
  }
6904
- if (programId === INITIALIZER_PROGRAM_ID || vestingConfig) {
6908
+ if (programId === INITIALIZER_PROGRAM_ID || programId === MAINNET_INITIALIZER_PROGRAM_ID || vestingConfig) {
6905
6909
  keys.push(
6906
6910
  vestingConfig ? { address: vestingConfig, role: kit.AccountRole.READONLY } : { address: programId, role: kit.AccountRole.READONLY }
6907
6911
  );
@@ -9290,7 +9294,7 @@ function getRehypeStateEncoder() {
9290
9294
  ["beneficiaryCount", kit.getU8Encoder()],
9291
9295
  ["inflightKind", kit.getU8Encoder()],
9292
9296
  ["inflightDirection", kit.getU8Encoder()],
9293
- ["settlementAuthority", kit.getAddressEncoder()],
9297
+ ["reservedSettlementAuthority", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
9294
9298
  ["cumulativeRoutedBaseFees", kit.getU64Encoder()],
9295
9299
  ["cumulativeRoutedQuoteFees", kit.getU64Encoder()],
9296
9300
  ["settledInitializerBaseFees", kit.getU64Encoder()],
@@ -9337,7 +9341,7 @@ function getRehypeStateDecoder() {
9337
9341
  ["beneficiaryCount", kit.getU8Decoder()],
9338
9342
  ["inflightKind", kit.getU8Decoder()],
9339
9343
  ["inflightDirection", kit.getU8Decoder()],
9340
- ["settlementAuthority", kit.getAddressDecoder()],
9344
+ ["reservedSettlementAuthority", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
9341
9345
  ["cumulativeRoutedBaseFees", kit.getU64Decoder()],
9342
9346
  ["cumulativeRoutedQuoteFees", kit.getU64Decoder()],
9343
9347
  ["settledInitializerBaseFees", kit.getU64Decoder()],
@@ -9794,10 +9798,6 @@ async function getInitializeRehypeInstructionAsync(input, config) {
9794
9798
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
9795
9799
  const originalAccounts = {
9796
9800
  payer: { value: input.payer ?? null, isWritable: true },
9797
- settlementAuthority: {
9798
- value: input.settlementAuthority ?? null,
9799
- isWritable: false
9800
- },
9801
9801
  baseMint: { value: input.baseMint ?? null, isWritable: false },
9802
9802
  quoteMint: { value: input.quoteMint ?? null, isWritable: false },
9803
9803
  hookProgram: { value: input.hookProgram ?? null, isWritable: false },
@@ -9924,7 +9924,6 @@ async function getInitializeRehypeInstructionAsync(input, config) {
9924
9924
  return Object.freeze({
9925
9925
  accounts: [
9926
9926
  getAccountMeta("payer", accounts.payer),
9927
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
9928
9927
  getAccountMeta("baseMint", accounts.baseMint),
9929
9928
  getAccountMeta("quoteMint", accounts.quoteMint),
9930
9929
  getAccountMeta("hookProgram", accounts.hookProgram),
@@ -9944,10 +9943,6 @@ function getInitializeRehypeInstruction(input, config) {
9944
9943
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
9945
9944
  const originalAccounts = {
9946
9945
  payer: { value: input.payer ?? null, isWritable: true },
9947
- settlementAuthority: {
9948
- value: input.settlementAuthority ?? null,
9949
- isWritable: false
9950
- },
9951
9946
  baseMint: { value: input.baseMint ?? null, isWritable: false },
9952
9947
  quoteMint: { value: input.quoteMint ?? null, isWritable: false },
9953
9948
  hookProgram: { value: input.hookProgram ?? null, isWritable: false },
@@ -9978,7 +9973,6 @@ function getInitializeRehypeInstruction(input, config) {
9978
9973
  return Object.freeze({
9979
9974
  accounts: [
9980
9975
  getAccountMeta("payer", accounts.payer),
9981
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
9982
9976
  getAccountMeta("baseMint", accounts.baseMint),
9983
9977
  getAccountMeta("quoteMint", accounts.quoteMint),
9984
9978
  getAccountMeta("hookProgram", accounts.hookProgram),
@@ -9995,12 +9989,12 @@ function getInitializeRehypeInstruction(input, config) {
9995
9989
  });
9996
9990
  }
9997
9991
  function parseInitializeRehypeInstruction(instruction) {
9998
- if (instruction.accounts.length < 10) {
9992
+ if (instruction.accounts.length < 9) {
9999
9993
  throw new kit.SolanaError(
10000
9994
  kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
10001
9995
  {
10002
9996
  actualAccountMetas: instruction.accounts.length,
10003
- expectedAccountMetas: 10
9997
+ expectedAccountMetas: 9
10004
9998
  }
10005
9999
  );
10006
10000
  }
@@ -10014,7 +10008,6 @@ function parseInitializeRehypeInstruction(instruction) {
10014
10008
  programAddress: instruction.programAddress,
10015
10009
  accounts: {
10016
10010
  payer: getNextAccount(),
10017
- settlementAuthority: getNextAccount(),
10018
10011
  baseMint: getNextAccount(),
10019
10012
  quoteMint: getNextAccount(),
10020
10013
  hookProgram: getNextAccount(),
@@ -10209,10 +10202,7 @@ function getSettleFeesInstructionDataCodec() {
10209
10202
  async function getSettleFeesInstructionAsync(input, config) {
10210
10203
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
10211
10204
  const originalAccounts = {
10212
- settlementAuthority: {
10213
- value: input.settlementAuthority ?? null,
10214
- isWritable: true
10215
- },
10205
+ payer: { value: input.payer ?? null, isWritable: true },
10216
10206
  initializerProgram: {
10217
10207
  value: input.initializerProgram ?? null,
10218
10208
  isWritable: false
@@ -10430,7 +10420,7 @@ async function getSettleFeesInstructionAsync(input, config) {
10430
10420
  const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
10431
10421
  return Object.freeze({
10432
10422
  accounts: [
10433
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
10423
+ getAccountMeta("payer", accounts.payer),
10434
10424
  getAccountMeta("initializerProgram", accounts.initializerProgram),
10435
10425
  getAccountMeta("initializerConfig", accounts.initializerConfig),
10436
10426
  getAccountMeta("launch", accounts.launch),
@@ -10467,10 +10457,7 @@ async function getSettleFeesInstructionAsync(input, config) {
10467
10457
  function getSettleFeesInstruction(input, config) {
10468
10458
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
10469
10459
  const originalAccounts = {
10470
- settlementAuthority: {
10471
- value: input.settlementAuthority ?? null,
10472
- isWritable: true
10473
- },
10460
+ payer: { value: input.payer ?? null, isWritable: true },
10474
10461
  initializerProgram: {
10475
10462
  value: input.initializerProgram ?? null,
10476
10463
  isWritable: false
@@ -10542,7 +10529,7 @@ function getSettleFeesInstruction(input, config) {
10542
10529
  const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
10543
10530
  return Object.freeze({
10544
10531
  accounts: [
10545
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
10532
+ getAccountMeta("payer", accounts.payer),
10546
10533
  getAccountMeta("initializerProgram", accounts.initializerProgram),
10547
10534
  getAccountMeta("initializerConfig", accounts.initializerConfig),
10548
10535
  getAccountMeta("launch", accounts.launch),
@@ -10599,7 +10586,7 @@ function parseSettleFeesInstruction(instruction) {
10599
10586
  return {
10600
10587
  programAddress: instruction.programAddress,
10601
10588
  accounts: {
10602
- settlementAuthority: getNextAccount(),
10589
+ payer: getNextAccount(),
10603
10590
  initializerProgram: getNextAccount(),
10604
10591
  initializerConfig: getNextAccount(),
10605
10592
  launch: getNextAccount(),
@@ -10678,10 +10665,7 @@ function getSettleMigratedFeesInstructionDataCodec() {
10678
10665
  async function getSettleMigratedFeesInstructionAsync(input, config) {
10679
10666
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
10680
10667
  const originalAccounts = {
10681
- settlementAuthority: {
10682
- value: input.settlementAuthority ?? null,
10683
- isWritable: true
10684
- },
10668
+ payer: { value: input.payer ?? null, isWritable: true },
10685
10669
  initializerProgram: {
10686
10670
  value: input.initializerProgram ?? null,
10687
10671
  isWritable: false
@@ -10874,7 +10858,7 @@ async function getSettleMigratedFeesInstructionAsync(input, config) {
10874
10858
  const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
10875
10859
  return Object.freeze({
10876
10860
  accounts: [
10877
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
10861
+ getAccountMeta("payer", accounts.payer),
10878
10862
  getAccountMeta("initializerProgram", accounts.initializerProgram),
10879
10863
  getAccountMeta("initializerConfig", accounts.initializerConfig),
10880
10864
  getAccountMeta("launch", accounts.launch),
@@ -10914,10 +10898,7 @@ async function getSettleMigratedFeesInstructionAsync(input, config) {
10914
10898
  function getSettleMigratedFeesInstruction(input, config) {
10915
10899
  const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
10916
10900
  const originalAccounts = {
10917
- settlementAuthority: {
10918
- value: input.settlementAuthority ?? null,
10919
- isWritable: true
10920
- },
10901
+ payer: { value: input.payer ?? null, isWritable: true },
10921
10902
  initializerProgram: {
10922
10903
  value: input.initializerProgram ?? null,
10923
10904
  isWritable: false
@@ -10998,7 +10979,7 @@ function getSettleMigratedFeesInstruction(input, config) {
10998
10979
  const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
10999
10980
  return Object.freeze({
11000
10981
  accounts: [
11001
- getAccountMeta("settlementAuthority", accounts.settlementAuthority),
10982
+ getAccountMeta("payer", accounts.payer),
11002
10983
  getAccountMeta("initializerProgram", accounts.initializerProgram),
11003
10984
  getAccountMeta("initializerConfig", accounts.initializerConfig),
11004
10985
  getAccountMeta("launch", accounts.launch),
@@ -11058,7 +11039,7 @@ function parseSettleMigratedFeesInstruction(instruction) {
11058
11039
  return {
11059
11040
  programAddress: instruction.programAddress,
11060
11041
  accounts: {
11061
- settlementAuthority: getNextAccount(),
11042
+ payer: getNextAccount(),
11062
11043
  initializerProgram: getNextAccount(),
11063
11044
  initializerConfig: getNextAccount(),
11064
11045
  launch: getNextAccount(),
@@ -11323,11 +11304,17 @@ function dopplerRehypeRouterV1Program() {
11323
11304
  ),
11324
11305
  settleFees: (input) => programClientCore.addSelfPlanAndSendFunctions(
11325
11306
  client,
11326
- getSettleFeesInstructionAsync(input)
11307
+ getSettleFeesInstructionAsync({
11308
+ ...input,
11309
+ payer: input.payer ?? client.payer
11310
+ })
11327
11311
  ),
11328
11312
  settleMigratedFees: (input) => programClientCore.addSelfPlanAndSendFunctions(
11329
11313
  client,
11330
- getSettleMigratedFeesInstructionAsync(input)
11314
+ getSettleMigratedFeesInstructionAsync({
11315
+ ...input,
11316
+ payer: input.payer ?? client.payer
11317
+ })
11331
11318
  )
11332
11319
  }
11333
11320
  }
@@ -11948,7 +11935,7 @@ var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
11948
11935
  };
11949
11936
  var DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES = {
11950
11937
  cpmmProgram: kit.address("5pXzd9UiWrVxATCYWmgo5EbfxzXqHYhfSKGdCPXPz7vK"),
11951
- initializerProgram: kit.address("4carc9eePfE7jKUXdCAYMhcPf4awEFpZPrz1sTykdss1"),
11938
+ initializerProgram: MAINNET_INITIALIZER_PROGRAM_ID,
11952
11939
  cpmmMigratorProgram: kit.address(
11953
11940
  "H71WD4tsiCCipro4urykWHySH1ryvLTmqEdNbHTGwb3o"
11954
11941
  ),
@@ -11961,6 +11948,15 @@ var DOPPLER_SOLANA_DEVNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES = {
11961
11948
  dopplerLaunchHookV2Program: DOPPLER_LAUNCH_HOOK_V2_PROGRAM_ID,
11962
11949
  dopplerRehypeRouterV1Program: DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS
11963
11950
  };
11951
+ var DOPPLER_SOLANA_MAINNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES = {
11952
+ initializerProgram: MAINNET_INITIALIZER_PROGRAM_ID,
11953
+ dopplerLaunchHookV2Program: kit.address(
11954
+ "7ZueM1Tef2QA5zrFtVJMDM8MFqkoeG8fog1mXPgmLGH1"
11955
+ ),
11956
+ dopplerRehypeRouterV1Program: kit.address(
11957
+ "BpHX6orJ73qCvsfKkSMARQtqJvSPfqXNUfoes5rMND1D"
11958
+ )
11959
+ };
11964
11960
  async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
11965
11961
  const [cpmmConfig] = await chunkO2Z5ORGF_cjs.getConfigAddress(programs.cpmmProgram);
11966
11962
  const [initializerConfig] = await getConfigAddress2(
@@ -13574,7 +13570,6 @@ async function prepareLaunch(input) {
13574
13570
  namespace,
13575
13571
  launchId,
13576
13572
  buybackDestination: input.buybackDestination,
13577
- settlementAuthority: input.settlementAuthority,
13578
13573
  routingMode: input.strategy.routingMode,
13579
13574
  feeRouting: input.strategy.feeRouting,
13580
13575
  beneficiaries
@@ -13725,7 +13720,7 @@ async function prepareSettlement(input) {
13725
13720
  ))[0] : void 0;
13726
13721
  const feeState = feeStateAccount.data;
13727
13722
  const routingState = routingStateAccount.data;
13728
- 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) {
13723
+ 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) {
13729
13724
  throw new Error("fee rehypothecation state does not match the launch");
13730
13725
  }
13731
13726
  if (routingState.pendingCrossBase !== 0n || routingState.pendingCrossQuote !== 0n || routingState.pendingLpBase !== 0n || routingState.pendingLpQuote !== 0n || routingState.inflightKind !== 0 || routingState.inflightAmountIn !== 0n || routingState.inflightExpectedAmountOut !== 0n) {
@@ -13832,7 +13827,7 @@ async function prepareSettlement(input) {
13832
13827
  });
13833
13828
  const instruction = await getSettleFeesInstructionAsync(
13834
13829
  {
13835
- settlementAuthority: input.settlementAuthority,
13830
+ payer: input.payer,
13836
13831
  initializerProgram: deployment.initializerProgram,
13837
13832
  initializerConfig: deployment.initializerConfig,
13838
13833
  launch: input.launch,
@@ -15253,6 +15248,7 @@ async function assertMigrationQuoteThreshold({
15253
15248
 
15254
15249
  exports.DOPPLER_SOLANA_DEVNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES = DOPPLER_SOLANA_DEVNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES;
15255
15250
  exports.DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES;
15251
+ exports.DOPPLER_SOLANA_MAINNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES = DOPPLER_SOLANA_MAINNET_FEE_REHYPOTHECATION_PROGRAM_ADDRESSES;
15256
15252
  exports.DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES = DOPPLER_SOLANA_MAINNET_PROGRAM_ADDRESSES;
15257
15253
  exports.assertMigrationQuoteThreshold = assertMigrationQuoteThreshold;
15258
15254
  exports.cpmm = cpmm_exports;