@whetstone-research/doppler-sdk 1.0.14 → 1.0.15
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.
- package/dist/solana/index.cjs +39 -7
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +16 -2
- package/dist/solana/index.d.ts +16 -2
- package/dist/solana/index.js +38 -8
- package/dist/solana/index.js.map +1 -1
- package/package.json +1 -1
package/dist/solana/index.cjs
CHANGED
|
@@ -6479,13 +6479,20 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
6479
6479
|
)
|
|
6480
6480
|
)
|
|
6481
6481
|
);
|
|
6482
|
-
|
|
6483
|
-
|
|
6482
|
+
const shouldAppendCpmmMigratorAccounts = accounts.cpmmConfig !== void 0 || migratorProgram === CPMM_MIGRATOR_PROGRAM_ID;
|
|
6483
|
+
if (shouldAppendCpmmMigratorAccounts) {
|
|
6484
|
+
if (!migratorProgram) {
|
|
6484
6485
|
throw new Error(
|
|
6485
|
-
"
|
|
6486
|
+
"migratorProgram is required when cpmmConfig is provided"
|
|
6486
6487
|
);
|
|
6487
6488
|
}
|
|
6488
|
-
|
|
6489
|
+
if (!accounts.cpmmConfig) {
|
|
6490
|
+
throw new Error("cpmmConfig is required when using the CPMM migrator");
|
|
6491
|
+
}
|
|
6492
|
+
const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
|
|
6493
|
+
launch,
|
|
6494
|
+
migratorProgram
|
|
6495
|
+
);
|
|
6489
6496
|
keys.push({ address: cpmmMigrationState, role: kit.AccountRole.WRITABLE });
|
|
6490
6497
|
keys.push({ address: accounts.cpmmConfig, role: kit.AccountRole.READONLY });
|
|
6491
6498
|
}
|
|
@@ -7009,10 +7016,14 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
7009
7016
|
adminBaseAta,
|
|
7010
7017
|
adminQuoteAta,
|
|
7011
7018
|
recipientAtas,
|
|
7012
|
-
cpmmProgram = chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID
|
|
7019
|
+
cpmmProgram = chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID,
|
|
7020
|
+
cpmmMigratorProgram = CPMM_MIGRATOR_PROGRAM_ID
|
|
7013
7021
|
}) {
|
|
7014
|
-
const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
|
|
7015
|
-
|
|
7022
|
+
const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
|
|
7023
|
+
launch,
|
|
7024
|
+
cpmmMigratorProgram
|
|
7025
|
+
);
|
|
7026
|
+
const [migrationAuthority] = await getCpmmMigrationAuthorityAddress(cpmmMigratorProgram);
|
|
7016
7027
|
const poolInit = await chunk3BW6IVP3_cjs.getPoolInitAddresses(baseMint, quoteMint, cpmmProgram);
|
|
7017
7028
|
const pool = poolInit.pool[0];
|
|
7018
7029
|
const [launchLpPosition] = await chunk3BW6IVP3_cjs.getPositionAddress(
|
|
@@ -7761,8 +7772,29 @@ async function getOracleStateAddress(oracleAuthority, nonce) {
|
|
|
7761
7772
|
});
|
|
7762
7773
|
}
|
|
7763
7774
|
|
|
7775
|
+
// src/solana/deployment.ts
|
|
7776
|
+
var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
|
|
7777
|
+
cpmmProgram: chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID,
|
|
7778
|
+
initializerProgram: INITIALIZER_PROGRAM_ID,
|
|
7779
|
+
cpmmMigratorProgram: CPMM_MIGRATOR_PROGRAM_ID,
|
|
7780
|
+
cpmmHookProgram: CPMM_HOOK_PROGRAM_ID
|
|
7781
|
+
};
|
|
7782
|
+
async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
|
|
7783
|
+
const [cpmmConfig] = await chunk3BW6IVP3_cjs.getConfigAddress(programs.cpmmProgram);
|
|
7784
|
+
const [initializerConfig] = await getConfigAddress2(
|
|
7785
|
+
programs.initializerProgram
|
|
7786
|
+
);
|
|
7787
|
+
return {
|
|
7788
|
+
...programs,
|
|
7789
|
+
cpmmConfig,
|
|
7790
|
+
initializerConfig
|
|
7791
|
+
};
|
|
7792
|
+
}
|
|
7793
|
+
|
|
7794
|
+
exports.DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES;
|
|
7764
7795
|
exports.cpmm = cpmm_exports;
|
|
7765
7796
|
exports.cpmmMigrator = cpmmMigrator_exports;
|
|
7797
|
+
exports.deriveSolanaCpmmDeployment = deriveSolanaCpmmDeployment;
|
|
7766
7798
|
exports.initializer = initializer_exports;
|
|
7767
7799
|
exports.predictionMigrator = predictionMigrator_exports;
|
|
7768
7800
|
exports.trustedOracle = trustedOracle_exports;
|