@whetstone-research/doppler-sdk 1.0.25 → 1.0.27
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 +20 -8
- package/dist/{chunk-BESE77DM.js → chunk-RVDRWCJN.js} +3 -3
- package/dist/{chunk-BESE77DM.js.map → chunk-RVDRWCJN.js.map} +1 -1
- package/dist/{chunk-Y6TJIH33.cjs → chunk-U6B52TBT.cjs} +13 -4
- package/dist/chunk-U6B52TBT.cjs.map +1 -0
- package/dist/{chunk-ZUJKBFXW.js → chunk-WD5VOZGI.js} +8 -5
- package/dist/chunk-WD5VOZGI.js.map +1 -0
- package/dist/{chunk-KJ6W44WF.cjs → chunk-XTL2GBZ4.cjs} +36 -36
- package/dist/{chunk-KJ6W44WF.cjs.map → chunk-XTL2GBZ4.cjs.map} +1 -1
- package/dist/evm/index.cjs +252 -68
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +46 -6
- package/dist/evm/index.d.ts +46 -6
- package/dist/evm/index.js +251 -69
- package/dist/evm/index.js.map +1 -1
- package/dist/{pda-A4PIAS5Y.cjs → pda-H6VMGONM.cjs} +17 -17
- package/dist/pda-H6VMGONM.cjs.map +1 -0
- package/dist/{pda-JVAD45XJ.js → pda-UJLXCO6I.js} +3 -3
- package/dist/pda-UJLXCO6I.js.map +1 -0
- package/dist/solana/index.cjs +1250 -825
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +444 -279
- package/dist/solana/index.d.ts +444 -279
- package/dist/solana/index.js +917 -493
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/react/index.cjs +45 -45
- package/dist/solana/react/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-Y6TJIH33.cjs.map +0 -1
- package/dist/chunk-ZUJKBFXW.js.map +0 -1
- package/dist/pda-A4PIAS5Y.cjs.map +0 -1
- package/dist/pda-JVAD45XJ.js.map +0 -1
package/README.md
CHANGED
|
@@ -88,10 +88,16 @@ console.log('CPMM config:', cpmmConfig);
|
|
|
88
88
|
console.log('Pool:', pool?.address ?? 'not found');
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
For runnable Solana flows,
|
|
91
|
+
For runnable Solana flows, configure `examples/.env` and run with `pnpm tsx`, for example `pnpm tsx examples/solana-launch-by-marketcap.ts`:
|
|
92
92
|
|
|
93
93
|
- [examples/solana-launch-by-marketcap.ts](./examples/solana-launch-by-marketcap.ts)
|
|
94
|
+
- [examples/solana-adv-launch.ts](./examples/solana-adv-launch.ts)
|
|
94
95
|
- [examples/solana-adv-e2e-launch.ts](./examples/solana-adv-e2e-launch.ts)
|
|
96
|
+
- [examples/solana-cosigner-gated-launch.ts](./examples/solana-cosigner-gated-launch.ts)
|
|
97
|
+
- [examples/solana-cosigner-gated-buy.ts](./examples/solana-cosigner-gated-buy.ts)
|
|
98
|
+
- [examples/solana-usdc-e2e-launch.ts](./examples/solana-usdc-e2e-launch.ts)
|
|
99
|
+
- [examples/solana-usdc-cosigner-gated-buy.ts](./examples/solana-usdc-cosigner-gated-buy.ts)
|
|
100
|
+
- [examples/solana-prediction-market.ts](./examples/solana-prediction-market.ts)
|
|
95
101
|
- [examples/solana-swap.ts](./examples/solana-swap.ts)
|
|
96
102
|
|
|
97
103
|
## Creating Auctions
|
|
@@ -438,9 +444,9 @@ console.log('Token address:', presetResult.tokenAddress);
|
|
|
438
444
|
|
|
439
445
|
The preset helper seeds three curated curve buckets sized for ~1B token supply targets:
|
|
440
446
|
|
|
441
|
-
- `low`:
|
|
442
|
-
- `medium`:
|
|
443
|
-
- `high`:
|
|
447
|
+
- `low`: 50% of the sale allocated to a $0-$3M market cap window.
|
|
448
|
+
- `medium`: 25% targeting roughly $1k-$40M market caps.
|
|
449
|
+
- `high`: 24% aimed at $100k-$1B market caps.
|
|
444
450
|
|
|
445
451
|
Pass `presets` to pick a subset (e.g. `['medium', 'high']`) or provide `overrides` to adjust ticks, positions, or shares for a specific tier. When the selected presets sum to less than 100%, the builder automatically appends a filler curve (using the highest selected tier's shape) so liquidity always covers the full sale. Shares must stay within 0-1e18 and the helper will throw if the total ever exceeds 100%.
|
|
446
452
|
|
|
@@ -908,6 +914,8 @@ import { Derc20 } from '@whetstone-research/doppler-sdk/evm';
|
|
|
908
914
|
const tokenDirect = new Derc20(publicClient, walletClient, tokenAddress);
|
|
909
915
|
```
|
|
910
916
|
|
|
917
|
+
For a runnable release-focused example covering legacy DERC20, DERC20 V2 schedules, and DopplerERC20V1 partial releases, see [examples/vesting-release.ts](./examples/vesting-release.ts).
|
|
918
|
+
|
|
911
919
|
### DopplerERC20V1 Tokens
|
|
912
920
|
|
|
913
921
|
Use the newer DopplerERC20V1 token template by either setting `type: 'dopplerERC20V1'` explicitly or by passing fields such as `maxBalanceLimit` with `balanceLimitEnd`, `controller`, or `excludedFromBalanceLimit`. When selected, the SDK uses the configured `dopplerERC20V1Factory` by default. `withTokenFactory(address)` is a generic factory override and takes precedence, but it must point to a factory compatible with the selected token path and token data ABI. `controller` is optional and defaults to the zero address, set it only if early balance-limit disable should be possible. Standard configs without the specific fields still use the legacy `standard` path, where cliff/allocation vesting routes to legacy DERC20 V2. Keep explicit `type: 'dopplerERC20V1'` when you want its behavior but have no specific fields to infer from.
|
|
@@ -1421,6 +1429,10 @@ for (const id of SUPPORTED_CHAIN_IDS) {
|
|
|
1421
1429
|
}
|
|
1422
1430
|
```
|
|
1423
1431
|
|
|
1432
|
+
Robinhood Chain is available as `CHAIN_IDS.ROBINHOOD` (`4663`). The SDK exposes
|
|
1433
|
+
addresses and support checks for it, but does not export a viem chain definition;
|
|
1434
|
+
use your application's chain/client setup when constructing clients.
|
|
1435
|
+
|
|
1424
1436
|
## Advanced Usage
|
|
1425
1437
|
|
|
1426
1438
|
### Custom Vesting Configuration
|
|
@@ -1776,7 +1788,7 @@ pnpm dev
|
|
|
1776
1788
|
|
|
1777
1789
|
The SDK includes comprehensive tests covering:
|
|
1778
1790
|
|
|
1779
|
-
- **Airlock Whitelisting**: Verifies that all modules are properly whitelisted on Ethereum Mainnet, Monad Mainnet, Base Mainnet, and
|
|
1791
|
+
- **Airlock Whitelisting**: Verifies that all modules are properly whitelisted on Ethereum Mainnet, Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain
|
|
1780
1792
|
- **Multicurve Functionality**: Tests multicurve auction creation and quoting
|
|
1781
1793
|
- **Token Address Mining**: Tests for generating optimized token addresses
|
|
1782
1794
|
|
|
@@ -1790,10 +1802,10 @@ pnpm test:whitelisting
|
|
|
1790
1802
|
ALCHEMY_API_KEY=your_key_here pnpm test:whitelisting
|
|
1791
1803
|
|
|
1792
1804
|
# Limit to specific whitelist-audit chains when needed
|
|
1793
|
-
TEST_CHAINS=mainnet,base,base-sepolia,monad-mainnet pnpm test:whitelisting
|
|
1805
|
+
TEST_CHAINS=mainnet,base,base-sepolia,monad-mainnet,robinhood pnpm test:whitelisting
|
|
1794
1806
|
```
|
|
1795
1807
|
|
|
1796
|
-
The whitelisting suite is scoped to the release-audit chains: Ethereum Mainnet, Monad Mainnet, Base Mainnet, and
|
|
1808
|
+
The whitelisting suite is scoped to the release-audit chains: Ethereum Mainnet, Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain.
|
|
1797
1809
|
|
|
1798
1810
|
Whitelisting test RPC priority is:
|
|
1799
1811
|
|
|
@@ -1827,7 +1839,7 @@ If you're migrating from `doppler-v3-sdk` or `doppler-v4-sdk`, see our [Migratio
|
|
|
1827
1839
|
|
|
1828
1840
|
## Contributing
|
|
1829
1841
|
|
|
1830
|
-
Contributions are welcome! Please see our [Contributing Guide](
|
|
1842
|
+
Contributions are welcome! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
|
|
1831
1843
|
|
|
1832
1844
|
## License
|
|
1833
1845
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MAX_HOOK_ALLOWLIST, MAX_ORACLE_OBSERVATIONS, ACCOUNT_DISCRIMINATORS, CPMM_PROGRAM_ID, Q64_ONE, BPS_DENOM, getPoolAddress, sortMints, getPositionAddress, getOracleAddress } from './chunk-
|
|
1
|
+
import { MAX_HOOK_ALLOWLIST, MAX_ORACLE_OBSERVATIONS, ACCOUNT_DISCRIMINATORS, CPMM_PROGRAM_ID, Q64_ONE, BPS_DENOM, getPoolAddress, sortMints, getPositionAddress, getOracleAddress } from './chunk-WD5VOZGI.js';
|
|
2
2
|
import { getAddressCodec, getBooleanCodec, getU8Codec, getU16Codec, getU32Codec, getU64Codec, getU128Codec, transformCodec, getArrayCodec, fixCodecSize, getBytesCodec, getStructCodec, getHiddenPrefixDecoder, getConstantDecoder, mergeBytes, fixEncoderSize, getBytesEncoder, transformEncoder, getStructEncoder, getStructDecoder, fixDecoderSize, getBytesDecoder, combineCodec, SolanaError, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, getU64Encoder, getU64Decoder, getProgramDerivedAddress, getAddressEncoder, getU16Encoder, getBooleanEncoder, getArrayEncoder, getAddressDecoder, getU16Decoder, getBooleanDecoder, getArrayDecoder, getU128Encoder, getU32Encoder, getU128Decoder, getU32Decoder, getU8Encoder, getU8Decoder } from '@solana/kit';
|
|
3
3
|
import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount, getNonNullResolvedInstructionInput } from '@solana/program-client-core';
|
|
4
4
|
|
|
@@ -3836,5 +3836,5 @@ function comparePoolAndOraclePrices(pool, oracle) {
|
|
|
3836
3836
|
}
|
|
3837
3837
|
|
|
3838
3838
|
export { ADD_LIQUIDITY_DISCRIMINATOR, CLOSE_POSITION_DISCRIMINATOR, COLLECT_FEES_DISCRIMINATOR, COLLECT_PROTOCOL_FEES_DISCRIMINATOR, CPMM_PROGRAM_ADDRESS, CREATE_POSITION_DISCRIMINATOR, INITIALIZE_CONFIG_DISCRIMINATOR, INITIALIZE_ORACLE_DISCRIMINATOR, INITIALIZE_POOL_DISCRIMINATOR, ORACLE_CONSULT_DISCRIMINATOR, ORACLE_UPDATE_DISCRIMINATOR, PAUSE_DISCRIMINATOR, PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR, REDEEM_PROTOCOL_SHARES_DISCRIMINATOR, REMOVE_LIQUIDITY_DISCRIMINATOR, SET_FEES_DISCRIMINATOR, SET_HOOK_DISCRIMINATOR, SWAP_EXACT_IN_DISCRIMINATOR, TRANSFER_ADMIN_DISCRIMINATOR, UNPAUSE_DISCRIMINATOR, UPDATE_CONFIG_DISCRIMINATOR, WITHDRAW_VAULT_EXCESS_DISCRIMINATOR, addLiquidityArgsCodec, ammConfigDataCodec, calculateAccruedFees, calculateTwap, calculateTwapNumber, ceilDiv, collectFeesArgsCodec, collectProtocolFeesArgsCodec, comparePoolAndOraclePrices, computePrice0Q64, computePrice1Q64, consultTwap, createPositionArgsCodec, decodeAmmConfig, decodeOracleState, decodePool, decodePosition, encodeAddLiquidityArgs, encodeCollectFeesArgs, encodeCollectProtocolFeesArgs, encodeCreatePositionArgs, encodeInitializeConfigArgs, encodeInitializeOracleArgs, encodeInitializePoolArgs, encodeInstructionData, encodeOracleConsultArgs, encodeRemoveLiquidityArgs, encodeSetFeesArgs, encodeSetHookArgs, encodeSwapExactInArgs, encodeTransferAdminArgs, fetchAllPools, fetchOracle, fetchOraclesBatch, fetchPool, fetchPoolPositions, fetchPoolsBatch, fetchPosition, fetchPositionByParams, fetchPositionsBatch, fetchUserPositions, filterActivePositions, filterPoolsByMint, getAddLiquidityDiscriminatorBytes, getAddLiquidityInstruction, getAddLiquidityInstructionAsync, getAddLiquidityInstructionDataCodec, getAddLiquidityInstructionDataDecoder, getAddLiquidityInstructionDataEncoder, getAddLiquidityQuote, getClosePositionDiscriminatorBytes, getClosePositionInstruction, getClosePositionInstructionDataCodec, getClosePositionInstructionDataDecoder, getClosePositionInstructionDataEncoder, getCollectFeesDiscriminatorBytes, getCollectFeesInstruction, getCollectFeesInstructionAsync, getCollectFeesInstructionDataCodec, getCollectFeesInstructionDataDecoder, getCollectFeesInstructionDataEncoder, getCollectProtocolFeesDiscriminatorBytes, getCollectProtocolFeesInstruction, getCollectProtocolFeesInstructionAsync, getCollectProtocolFeesInstructionDataCodec, getCollectProtocolFeesInstructionDataDecoder, getCollectProtocolFeesInstructionDataEncoder, getCreatePositionDiscriminatorBytes, getCreatePositionInstruction, getCreatePositionInstructionAsync, getCreatePositionInstructionDataCodec, getCreatePositionInstructionDataDecoder, getCreatePositionInstructionDataEncoder, getInitializeConfigDiscriminatorBytes, getInitializeConfigInstruction, getInitializeConfigInstructionAsync, getInitializeConfigInstructionDataCodec, getInitializeConfigInstructionDataDecoder, getInitializeConfigInstructionDataEncoder, getInitializeOracleDiscriminatorBytes, getInitializeOracleInstruction, getInitializeOracleInstructionAsync, getInitializeOracleInstructionDataCodec, getInitializeOracleInstructionDataDecoder, getInitializeOracleInstructionDataEncoder, getInitializePoolDiscriminatorBytes, getInitializePoolInstruction, getInitializePoolInstructionAsync, getInitializePoolInstructionDataCodec, getInitializePoolInstructionDataDecoder, getInitializePoolInstructionDataEncoder, getK, getOracleAddressFromPool, getOracleAge, getOracleBufferStats, getOracleConsultDiscriminatorBytes, getOracleConsultInstruction, getOracleConsultInstructionAsync, getOracleConsultInstructionDataCodec, getOracleConsultInstructionDataDecoder, getOracleConsultInstructionDataEncoder, getOracleDeviation, getOracleForPool, getOracleSpotPrices, getOracleUpdateDiscriminatorBytes, getOracleUpdateInstruction, getOracleUpdateInstructionAsync, getOracleUpdateInstructionDataCodec, getOracleUpdateInstructionDataDecoder, getOracleUpdateInstructionDataEncoder, getPauseDiscriminatorBytes, getPauseInstruction, getPauseInstructionDataCodec, getPauseInstructionDataDecoder, getPauseInstructionDataEncoder, getPendingFees, getPoolAddressFromMints, getPoolByMints, getPositionAddressFromParams, getPositionValue, getPreviewSwapExactInDiscriminatorBytes, getPreviewSwapExactInInstruction, getPreviewSwapExactInInstructionDataCodec, getPreviewSwapExactInInstructionDataDecoder, getPreviewSwapExactInInstructionDataEncoder, getRedeemProtocolSharesDiscriminatorBytes, getRedeemProtocolSharesInstruction, getRedeemProtocolSharesInstructionAsync, getRedeemProtocolSharesInstructionDataCodec, getRedeemProtocolSharesInstructionDataDecoder, getRedeemProtocolSharesInstructionDataEncoder, getRemoveLiquidityDiscriminatorBytes, getRemoveLiquidityInstruction, getRemoveLiquidityInstructionAsync, getRemoveLiquidityInstructionDataCodec, getRemoveLiquidityInstructionDataDecoder, getRemoveLiquidityInstructionDataEncoder, getRemoveLiquidityQuote, getSetFeesDiscriminatorBytes, getSetFeesInstruction, getSetFeesInstructionDataCodec, getSetFeesInstructionDataDecoder, getSetFeesInstructionDataEncoder, getSetHookDiscriminatorBytes, getSetHookInstruction, getSetHookInstructionDataCodec, getSetHookInstructionDataDecoder, getSetHookInstructionDataEncoder, getSpotPrice0, getSpotPrice1, getSwapExactInDiscriminatorBytes, getSwapExactInInstruction, getSwapExactInInstructionAsync, getSwapExactInInstructionDataCodec, getSwapExactInInstructionDataDecoder, getSwapExactInInstructionDataEncoder, getSwapQuote, getSwapQuoteExactOut, getTransferAdminDiscriminatorBytes, getTransferAdminInstruction, getTransferAdminInstructionDataCodec, getTransferAdminInstructionDataDecoder, getTransferAdminInstructionDataEncoder, getTvl, getUnpauseDiscriminatorBytes, getUnpauseInstruction, getUnpauseInstructionDataCodec, getUnpauseInstructionDataDecoder, getUnpauseInstructionDataEncoder, getUpdateConfigDiscriminatorBytes, getUpdateConfigInstruction, getUpdateConfigInstructionDataCodec, getUpdateConfigInstructionDataDecoder, getUpdateConfigInstructionDataEncoder, getWithdrawVaultExcessDiscriminatorBytes, getWithdrawVaultExcessInstruction, getWithdrawVaultExcessInstructionAsync, getWithdrawVaultExcessInstructionDataCodec, getWithdrawVaultExcessInstructionDataDecoder, getWithdrawVaultExcessInstructionDataEncoder, initializeConfigArgsCodec, initializeOracleArgsCodec, initializePoolArgsCodec, isOracleStale, isqrt, maxBigInt, minBigInt, numberToQ64, observationCodec, oracleConsultArgsCodec, oracleStateDataCodec, parseAddLiquidityInstruction, parseClosePositionInstruction, parseCollectFeesInstruction, parseCollectProtocolFeesInstruction, parseCreatePositionInstruction, parseInitializeConfigInstruction, parseInitializeOracleInstruction, parseInitializePoolInstruction, parseOracleConsultInstruction, parseOracleUpdateInstruction, parsePauseInstruction, parsePreviewSwapExactInInstruction, parseRedeemProtocolSharesInstruction, parseRemoveLiquidityInstruction, parseSetFeesInstruction, parseSetHookInstruction, parseSwapExactInInstruction, parseTransferAdminInstruction, parseUnpauseInstruction, parseUpdateConfigInstruction, parseWithdrawVaultExcessInstruction, poolDataCodec, poolExists, positionDataCodec, q64Div, q64Mul, q64ToNumber, ratioToNumber, removeLiquidityArgsCodec, setFeesArgsCodec, setHookArgsCodec, sortPoolsByReserves, sortPositionsByShares, swapExactInArgsCodec, transferAdminArgsCodec };
|
|
3839
|
-
//# sourceMappingURL=chunk-
|
|
3840
|
-
//# sourceMappingURL=chunk-
|
|
3839
|
+
//# sourceMappingURL=chunk-RVDRWCJN.js.map
|
|
3840
|
+
//# sourceMappingURL=chunk-RVDRWCJN.js.map
|