@whetstone-research/doppler-sdk 1.0.20 → 1.0.22
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/README.md +27 -17
- package/dist/evm/index.cjs +426 -195
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +118 -11
- package/dist/evm/index.d.ts +118 -11
- package/dist/evm/index.js +427 -197
- package/dist/evm/index.js.map +1 -1
- package/dist/solana/index.cjs +38 -8
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +36 -7
- package/dist/solana/index.d.ts +36 -7
- package/dist/solana/index.js +39 -9
- package/dist/solana/index.js.map +1 -1
- package/package.json +1 -1
package/dist/solana/index.cjs
CHANGED
|
@@ -1688,8 +1688,11 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
1688
1688
|
SEED_LAUNCH: () => SEED_LAUNCH,
|
|
1689
1689
|
SEED_LAUNCH_AUTHORITY: () => SEED_LAUNCH_AUTHORITY,
|
|
1690
1690
|
SEED_LAUNCH_FEE_STATE: () => SEED_LAUNCH_FEE_STATE,
|
|
1691
|
+
SOLANA_TRANSACTION_SIZE_LIMIT: () => SOLANA_TRANSACTION_SIZE_LIMIT,
|
|
1691
1692
|
TRADE_DIRECTION_BUY: () => TRADE_DIRECTION_BUY,
|
|
1692
1693
|
TRADE_DIRECTION_SELL: () => TRADE_DIRECTION_SELL,
|
|
1694
|
+
assertTransactionMessageFits: () => assertTransactionMessageFits,
|
|
1695
|
+
assertTransactionMessageFitsWithLookupTable: () => assertTransactionMessageFitsWithLookupTable,
|
|
1693
1696
|
buildAddressLookupTableSetupInstructions: () => buildAddressLookupTableSetupInstructions,
|
|
1694
1697
|
compressTransactionMessageWithLookupTable: () => compressTransactionMessageWithLookupTable,
|
|
1695
1698
|
computeRemainingAccountsHash: () => computeRemainingAccountsHash,
|
|
@@ -1735,6 +1738,8 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
1735
1738
|
getTokenMetadataAddress: () => getTokenMetadataAddress,
|
|
1736
1739
|
launchExists: () => launchExists,
|
|
1737
1740
|
launchIdFromU64: () => launchIdFromU64,
|
|
1741
|
+
measureTransactionMessageSize: () => measureTransactionMessageSize,
|
|
1742
|
+
measureTransactionMessageSizeWithLookupTable: () => measureTransactionMessageSizeWithLookupTable,
|
|
1738
1743
|
phaseLabel: () => phaseLabel
|
|
1739
1744
|
});
|
|
1740
1745
|
var INITIALIZER_PROGRAM_ID = kit.address(
|
|
@@ -2033,11 +2038,9 @@ function getInitializeLaunchArgsEncoder() {
|
|
|
2033
2038
|
["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
2034
2039
|
["allowBuy", kit.getU8Encoder()],
|
|
2035
2040
|
["allowSell", kit.getU8Encoder()],
|
|
2036
|
-
["hookProgram", kit.getAddressEncoder()],
|
|
2037
2041
|
["hookFlags", kit.getU32Encoder()],
|
|
2038
2042
|
["hookPayload", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
2039
2043
|
["hookCreateRemainingAccountsLen", kit.getU32Encoder()],
|
|
2040
|
-
["migratorProgram", kit.getAddressEncoder()],
|
|
2041
2044
|
[
|
|
2042
2045
|
"migratorInitPayload",
|
|
2043
2046
|
kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
|
|
@@ -2074,11 +2077,9 @@ function getInitializeLaunchArgsDecoder() {
|
|
|
2074
2077
|
["curveParams", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
|
|
2075
2078
|
["allowBuy", kit.getU8Decoder()],
|
|
2076
2079
|
["allowSell", kit.getU8Decoder()],
|
|
2077
|
-
["hookProgram", kit.getAddressDecoder()],
|
|
2078
2080
|
["hookFlags", kit.getU32Decoder()],
|
|
2079
2081
|
["hookPayload", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
|
|
2080
2082
|
["hookCreateRemainingAccountsLen", kit.getU32Decoder()],
|
|
2081
|
-
["migratorProgram", kit.getAddressDecoder()],
|
|
2082
2083
|
[
|
|
2083
2084
|
"migratorInitPayload",
|
|
2084
2085
|
kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())
|
|
@@ -2653,11 +2654,9 @@ function getInitializeLaunchInstructionDataEncoder() {
|
|
|
2653
2654
|
["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
2654
2655
|
["allowBuy", kit.getU8Encoder()],
|
|
2655
2656
|
["allowSell", kit.getU8Encoder()],
|
|
2656
|
-
["hookProgram", kit.getAddressEncoder()],
|
|
2657
2657
|
["hookFlags", kit.getU32Encoder()],
|
|
2658
2658
|
["hookPayload", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
2659
2659
|
["hookCreateRemainingAccountsLen", kit.getU32Encoder()],
|
|
2660
|
-
["migratorProgram", kit.getAddressEncoder()],
|
|
2661
2660
|
[
|
|
2662
2661
|
"migratorInitPayload",
|
|
2663
2662
|
kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
|
|
@@ -5209,9 +5208,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
5209
5208
|
feeBeneficiaries: args.feeBeneficiaries ?? [],
|
|
5210
5209
|
allowBuy: args.allowBuy ? 1 : 0,
|
|
5211
5210
|
allowSell: args.allowSell ? 1 : 0,
|
|
5212
|
-
hookProgram: args.hookProgram ?? hookProgram ?? chunkY6TJIH33_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
5213
5211
|
hookCreateRemainingAccountsLen: args.hookCreateRemainingAccountsLen ?? hookCreateRemainingAccounts.length,
|
|
5214
|
-
migratorProgram: migratorProgram ?? chunkY6TJIH33_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
5215
5212
|
hookCreateRemainingAccountsHash: args.hookCreateRemainingAccountsHash ?? (createHooksEnabled ? computeRemainingAccountsHash(hookCreateRemainingAccountAddresses) : new Uint8Array(32))
|
|
5216
5213
|
};
|
|
5217
5214
|
const data = new Uint8Array(
|
|
@@ -5515,6 +5512,39 @@ function compressTransactionMessageWithLookupTable(transactionMessage, {
|
|
|
5515
5512
|
}
|
|
5516
5513
|
);
|
|
5517
5514
|
}
|
|
5515
|
+
var SOLANA_TRANSACTION_SIZE_LIMIT = 1232;
|
|
5516
|
+
function measureTransactionMessageSize(transactionMessage) {
|
|
5517
|
+
const size = kit.getTransactionMessageSize(transactionMessage);
|
|
5518
|
+
const overBy = Math.max(0, size - SOLANA_TRANSACTION_SIZE_LIMIT);
|
|
5519
|
+
return {
|
|
5520
|
+
size,
|
|
5521
|
+
limit: SOLANA_TRANSACTION_SIZE_LIMIT,
|
|
5522
|
+
overBy,
|
|
5523
|
+
fits: overBy === 0
|
|
5524
|
+
};
|
|
5525
|
+
}
|
|
5526
|
+
function measureTransactionMessageSizeWithLookupTable(transactionMessage, lookupTable) {
|
|
5527
|
+
return measureTransactionMessageSize(
|
|
5528
|
+
compressTransactionMessageWithLookupTable(transactionMessage, lookupTable)
|
|
5529
|
+
);
|
|
5530
|
+
}
|
|
5531
|
+
function assertTransactionMessageFits(transactionMessage, { label = "Transaction", metadataBytes } = {}) {
|
|
5532
|
+
const report = measureTransactionMessageSize(transactionMessage);
|
|
5533
|
+
if (report.fits) {
|
|
5534
|
+
return report;
|
|
5535
|
+
}
|
|
5536
|
+
const metadataHint = metadataBytes && metadataBytes > 0 ? ` Metadata contributes ${metadataBytes} instruction-data bytes; address lookup tables do not compress metadata strings.` : "";
|
|
5537
|
+
throw new Error(
|
|
5538
|
+
`${label} is ${report.size} bytes, exceeding Solana's ${report.limit}-byte transaction limit by ${report.overBy} bytes.${metadataHint}`
|
|
5539
|
+
);
|
|
5540
|
+
}
|
|
5541
|
+
function assertTransactionMessageFitsWithLookupTable(transactionMessage, lookupTable, options = {}) {
|
|
5542
|
+
const compressedMessage = compressTransactionMessageWithLookupTable(
|
|
5543
|
+
transactionMessage,
|
|
5544
|
+
lookupTable
|
|
5545
|
+
);
|
|
5546
|
+
return assertTransactionMessageFits(compressedMessage, options);
|
|
5547
|
+
}
|
|
5518
5548
|
var addressCodec5 = kit.getAddressCodec();
|
|
5519
5549
|
function bytesToBase64(bytes) {
|
|
5520
5550
|
let binary = "";
|