@whetstone-research/doppler-sdk 1.0.38 → 1.0.39
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 +24 -42
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +53 -56
- package/dist/solana/index.d.ts +53 -56
- package/dist/solana/index.js +24 -42
- package/dist/solana/index.js.map +1 -1
- package/package.json +1 -1
package/dist/solana/index.cjs
CHANGED
|
@@ -9290,7 +9290,7 @@ function getRehypeStateEncoder() {
|
|
|
9290
9290
|
["beneficiaryCount", kit.getU8Encoder()],
|
|
9291
9291
|
["inflightKind", kit.getU8Encoder()],
|
|
9292
9292
|
["inflightDirection", kit.getU8Encoder()],
|
|
9293
|
-
["
|
|
9293
|
+
["reservedSettlementAuthority", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
9294
9294
|
["cumulativeRoutedBaseFees", kit.getU64Encoder()],
|
|
9295
9295
|
["cumulativeRoutedQuoteFees", kit.getU64Encoder()],
|
|
9296
9296
|
["settledInitializerBaseFees", kit.getU64Encoder()],
|
|
@@ -9337,7 +9337,7 @@ function getRehypeStateDecoder() {
|
|
|
9337
9337
|
["beneficiaryCount", kit.getU8Decoder()],
|
|
9338
9338
|
["inflightKind", kit.getU8Decoder()],
|
|
9339
9339
|
["inflightDirection", kit.getU8Decoder()],
|
|
9340
|
-
["
|
|
9340
|
+
["reservedSettlementAuthority", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
9341
9341
|
["cumulativeRoutedBaseFees", kit.getU64Decoder()],
|
|
9342
9342
|
["cumulativeRoutedQuoteFees", kit.getU64Decoder()],
|
|
9343
9343
|
["settledInitializerBaseFees", kit.getU64Decoder()],
|
|
@@ -9794,10 +9794,6 @@ async function getInitializeRehypeInstructionAsync(input, config) {
|
|
|
9794
9794
|
const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
|
|
9795
9795
|
const originalAccounts = {
|
|
9796
9796
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
9797
|
-
settlementAuthority: {
|
|
9798
|
-
value: input.settlementAuthority ?? null,
|
|
9799
|
-
isWritable: false
|
|
9800
|
-
},
|
|
9801
9797
|
baseMint: { value: input.baseMint ?? null, isWritable: false },
|
|
9802
9798
|
quoteMint: { value: input.quoteMint ?? null, isWritable: false },
|
|
9803
9799
|
hookProgram: { value: input.hookProgram ?? null, isWritable: false },
|
|
@@ -9924,7 +9920,6 @@ async function getInitializeRehypeInstructionAsync(input, config) {
|
|
|
9924
9920
|
return Object.freeze({
|
|
9925
9921
|
accounts: [
|
|
9926
9922
|
getAccountMeta("payer", accounts.payer),
|
|
9927
|
-
getAccountMeta("settlementAuthority", accounts.settlementAuthority),
|
|
9928
9923
|
getAccountMeta("baseMint", accounts.baseMint),
|
|
9929
9924
|
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
9930
9925
|
getAccountMeta("hookProgram", accounts.hookProgram),
|
|
@@ -9944,10 +9939,6 @@ function getInitializeRehypeInstruction(input, config) {
|
|
|
9944
9939
|
const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
|
|
9945
9940
|
const originalAccounts = {
|
|
9946
9941
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
9947
|
-
settlementAuthority: {
|
|
9948
|
-
value: input.settlementAuthority ?? null,
|
|
9949
|
-
isWritable: false
|
|
9950
|
-
},
|
|
9951
9942
|
baseMint: { value: input.baseMint ?? null, isWritable: false },
|
|
9952
9943
|
quoteMint: { value: input.quoteMint ?? null, isWritable: false },
|
|
9953
9944
|
hookProgram: { value: input.hookProgram ?? null, isWritable: false },
|
|
@@ -9978,7 +9969,6 @@ function getInitializeRehypeInstruction(input, config) {
|
|
|
9978
9969
|
return Object.freeze({
|
|
9979
9970
|
accounts: [
|
|
9980
9971
|
getAccountMeta("payer", accounts.payer),
|
|
9981
|
-
getAccountMeta("settlementAuthority", accounts.settlementAuthority),
|
|
9982
9972
|
getAccountMeta("baseMint", accounts.baseMint),
|
|
9983
9973
|
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
9984
9974
|
getAccountMeta("hookProgram", accounts.hookProgram),
|
|
@@ -9995,12 +9985,12 @@ function getInitializeRehypeInstruction(input, config) {
|
|
|
9995
9985
|
});
|
|
9996
9986
|
}
|
|
9997
9987
|
function parseInitializeRehypeInstruction(instruction) {
|
|
9998
|
-
if (instruction.accounts.length <
|
|
9988
|
+
if (instruction.accounts.length < 9) {
|
|
9999
9989
|
throw new kit.SolanaError(
|
|
10000
9990
|
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
10001
9991
|
{
|
|
10002
9992
|
actualAccountMetas: instruction.accounts.length,
|
|
10003
|
-
expectedAccountMetas:
|
|
9993
|
+
expectedAccountMetas: 9
|
|
10004
9994
|
}
|
|
10005
9995
|
);
|
|
10006
9996
|
}
|
|
@@ -10014,7 +10004,6 @@ function parseInitializeRehypeInstruction(instruction) {
|
|
|
10014
10004
|
programAddress: instruction.programAddress,
|
|
10015
10005
|
accounts: {
|
|
10016
10006
|
payer: getNextAccount(),
|
|
10017
|
-
settlementAuthority: getNextAccount(),
|
|
10018
10007
|
baseMint: getNextAccount(),
|
|
10019
10008
|
quoteMint: getNextAccount(),
|
|
10020
10009
|
hookProgram: getNextAccount(),
|
|
@@ -10209,10 +10198,7 @@ function getSettleFeesInstructionDataCodec() {
|
|
|
10209
10198
|
async function getSettleFeesInstructionAsync(input, config) {
|
|
10210
10199
|
const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
|
|
10211
10200
|
const originalAccounts = {
|
|
10212
|
-
|
|
10213
|
-
value: input.settlementAuthority ?? null,
|
|
10214
|
-
isWritable: true
|
|
10215
|
-
},
|
|
10201
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
10216
10202
|
initializerProgram: {
|
|
10217
10203
|
value: input.initializerProgram ?? null,
|
|
10218
10204
|
isWritable: false
|
|
@@ -10430,7 +10416,7 @@ async function getSettleFeesInstructionAsync(input, config) {
|
|
|
10430
10416
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
10431
10417
|
return Object.freeze({
|
|
10432
10418
|
accounts: [
|
|
10433
|
-
getAccountMeta("
|
|
10419
|
+
getAccountMeta("payer", accounts.payer),
|
|
10434
10420
|
getAccountMeta("initializerProgram", accounts.initializerProgram),
|
|
10435
10421
|
getAccountMeta("initializerConfig", accounts.initializerConfig),
|
|
10436
10422
|
getAccountMeta("launch", accounts.launch),
|
|
@@ -10467,10 +10453,7 @@ async function getSettleFeesInstructionAsync(input, config) {
|
|
|
10467
10453
|
function getSettleFeesInstruction(input, config) {
|
|
10468
10454
|
const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
|
|
10469
10455
|
const originalAccounts = {
|
|
10470
|
-
|
|
10471
|
-
value: input.settlementAuthority ?? null,
|
|
10472
|
-
isWritable: true
|
|
10473
|
-
},
|
|
10456
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
10474
10457
|
initializerProgram: {
|
|
10475
10458
|
value: input.initializerProgram ?? null,
|
|
10476
10459
|
isWritable: false
|
|
@@ -10542,7 +10525,7 @@ function getSettleFeesInstruction(input, config) {
|
|
|
10542
10525
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
10543
10526
|
return Object.freeze({
|
|
10544
10527
|
accounts: [
|
|
10545
|
-
getAccountMeta("
|
|
10528
|
+
getAccountMeta("payer", accounts.payer),
|
|
10546
10529
|
getAccountMeta("initializerProgram", accounts.initializerProgram),
|
|
10547
10530
|
getAccountMeta("initializerConfig", accounts.initializerConfig),
|
|
10548
10531
|
getAccountMeta("launch", accounts.launch),
|
|
@@ -10599,7 +10582,7 @@ function parseSettleFeesInstruction(instruction) {
|
|
|
10599
10582
|
return {
|
|
10600
10583
|
programAddress: instruction.programAddress,
|
|
10601
10584
|
accounts: {
|
|
10602
|
-
|
|
10585
|
+
payer: getNextAccount(),
|
|
10603
10586
|
initializerProgram: getNextAccount(),
|
|
10604
10587
|
initializerConfig: getNextAccount(),
|
|
10605
10588
|
launch: getNextAccount(),
|
|
@@ -10678,10 +10661,7 @@ function getSettleMigratedFeesInstructionDataCodec() {
|
|
|
10678
10661
|
async function getSettleMigratedFeesInstructionAsync(input, config) {
|
|
10679
10662
|
const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
|
|
10680
10663
|
const originalAccounts = {
|
|
10681
|
-
|
|
10682
|
-
value: input.settlementAuthority ?? null,
|
|
10683
|
-
isWritable: true
|
|
10684
|
-
},
|
|
10664
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
10685
10665
|
initializerProgram: {
|
|
10686
10666
|
value: input.initializerProgram ?? null,
|
|
10687
10667
|
isWritable: false
|
|
@@ -10874,7 +10854,7 @@ async function getSettleMigratedFeesInstructionAsync(input, config) {
|
|
|
10874
10854
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
10875
10855
|
return Object.freeze({
|
|
10876
10856
|
accounts: [
|
|
10877
|
-
getAccountMeta("
|
|
10857
|
+
getAccountMeta("payer", accounts.payer),
|
|
10878
10858
|
getAccountMeta("initializerProgram", accounts.initializerProgram),
|
|
10879
10859
|
getAccountMeta("initializerConfig", accounts.initializerConfig),
|
|
10880
10860
|
getAccountMeta("launch", accounts.launch),
|
|
@@ -10914,10 +10894,7 @@ async function getSettleMigratedFeesInstructionAsync(input, config) {
|
|
|
10914
10894
|
function getSettleMigratedFeesInstruction(input, config) {
|
|
10915
10895
|
const programAddress = config?.programAddress ?? DOPPLER_REHYPE_ROUTER_V1_PROGRAM_ADDRESS;
|
|
10916
10896
|
const originalAccounts = {
|
|
10917
|
-
|
|
10918
|
-
value: input.settlementAuthority ?? null,
|
|
10919
|
-
isWritable: true
|
|
10920
|
-
},
|
|
10897
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
10921
10898
|
initializerProgram: {
|
|
10922
10899
|
value: input.initializerProgram ?? null,
|
|
10923
10900
|
isWritable: false
|
|
@@ -10998,7 +10975,7 @@ function getSettleMigratedFeesInstruction(input, config) {
|
|
|
10998
10975
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
10999
10976
|
return Object.freeze({
|
|
11000
10977
|
accounts: [
|
|
11001
|
-
getAccountMeta("
|
|
10978
|
+
getAccountMeta("payer", accounts.payer),
|
|
11002
10979
|
getAccountMeta("initializerProgram", accounts.initializerProgram),
|
|
11003
10980
|
getAccountMeta("initializerConfig", accounts.initializerConfig),
|
|
11004
10981
|
getAccountMeta("launch", accounts.launch),
|
|
@@ -11058,7 +11035,7 @@ function parseSettleMigratedFeesInstruction(instruction) {
|
|
|
11058
11035
|
return {
|
|
11059
11036
|
programAddress: instruction.programAddress,
|
|
11060
11037
|
accounts: {
|
|
11061
|
-
|
|
11038
|
+
payer: getNextAccount(),
|
|
11062
11039
|
initializerProgram: getNextAccount(),
|
|
11063
11040
|
initializerConfig: getNextAccount(),
|
|
11064
11041
|
launch: getNextAccount(),
|
|
@@ -11323,11 +11300,17 @@ function dopplerRehypeRouterV1Program() {
|
|
|
11323
11300
|
),
|
|
11324
11301
|
settleFees: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
11325
11302
|
client,
|
|
11326
|
-
getSettleFeesInstructionAsync(
|
|
11303
|
+
getSettleFeesInstructionAsync({
|
|
11304
|
+
...input,
|
|
11305
|
+
payer: input.payer ?? client.payer
|
|
11306
|
+
})
|
|
11327
11307
|
),
|
|
11328
11308
|
settleMigratedFees: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
11329
11309
|
client,
|
|
11330
|
-
getSettleMigratedFeesInstructionAsync(
|
|
11310
|
+
getSettleMigratedFeesInstructionAsync({
|
|
11311
|
+
...input,
|
|
11312
|
+
payer: input.payer ?? client.payer
|
|
11313
|
+
})
|
|
11331
11314
|
)
|
|
11332
11315
|
}
|
|
11333
11316
|
}
|
|
@@ -13574,7 +13557,6 @@ async function prepareLaunch(input) {
|
|
|
13574
13557
|
namespace,
|
|
13575
13558
|
launchId,
|
|
13576
13559
|
buybackDestination: input.buybackDestination,
|
|
13577
|
-
settlementAuthority: input.settlementAuthority,
|
|
13578
13560
|
routingMode: input.strategy.routingMode,
|
|
13579
13561
|
feeRouting: input.strategy.feeRouting,
|
|
13580
13562
|
beneficiaries
|
|
@@ -13725,7 +13707,7 @@ async function prepareSettlement(input) {
|
|
|
13725
13707
|
))[0] : void 0;
|
|
13726
13708
|
const feeState = feeStateAccount.data;
|
|
13727
13709
|
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 ||
|
|
13710
|
+
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
13711
|
throw new Error("fee rehypothecation state does not match the launch");
|
|
13730
13712
|
}
|
|
13731
13713
|
if (routingState.pendingCrossBase !== 0n || routingState.pendingCrossQuote !== 0n || routingState.pendingLpBase !== 0n || routingState.pendingLpQuote !== 0n || routingState.inflightKind !== 0 || routingState.inflightAmountIn !== 0n || routingState.inflightExpectedAmountOut !== 0n) {
|
|
@@ -13832,7 +13814,7 @@ async function prepareSettlement(input) {
|
|
|
13832
13814
|
});
|
|
13833
13815
|
const instruction = await getSettleFeesInstructionAsync(
|
|
13834
13816
|
{
|
|
13835
|
-
|
|
13817
|
+
payer: input.payer,
|
|
13836
13818
|
initializerProgram: deployment.initializerProgram,
|
|
13837
13819
|
initializerConfig: deployment.initializerConfig,
|
|
13838
13820
|
launch: input.launch,
|