clanker-sdk 4.2.3 → 4.2.5-canary.0

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.
@@ -1,7 +1,7 @@
1
- import { C as ClankerTransactionConfig, f as ClankerAirdrop_v4_abi, c as ClankerResult, g as Clanker_PresaleEthToCreator_v4_1_abi } from '../../write-clanker-contracts-B4LSHPv2.js';
1
+ import { C as ClankerTransactionConfig, f as ClankerAirdrop_v4_abi, c as ClankerResult, g as Clanker_PresaleEthToCreator_v4_1_abi, h as Clanker_PresaleAllowlist_v4_1_abi } from '../../write-clanker-contracts-CQTURFDk.js';
2
2
  import { MerkleTree } from '@openzeppelin/merkle-tree/dist/merkletree.js';
3
3
  import * as z from 'zod/v4';
4
- import { a as Chain, C as ClankerTokenV4 } from '../../clankerTokenV4-Btn0ZN4v.js';
4
+ import { a as Chain, C as ClankerTokenV4 } from '../../clankerTokenV4-xiAq6G4R.js';
5
5
  import { Clanker } from '../index.js';
6
6
  import { C as ClankerError } from '../../errors-5Gv28Tkr.js';
7
7
  import 'viem';
@@ -490,5 +490,195 @@ declare function withdrawFromPresale(data: {
490
490
  * @returns The allowlist contract address, or undefined if not available
491
491
  */
492
492
  declare function getAllowlistAddress(chainId: Chain): `0x${string}` | undefined;
493
+ /**
494
+ * Get a transaction to buy into a presale with allowlist proof
495
+ *
496
+ * Use this when buying into a presale that has an allowlist enabled.
497
+ * The proof must contain your allowlist proof data (merkle proof + allowed amount).
498
+ *
499
+ * @param presaleId The ID of the presale
500
+ * @param chainId The chain ID
501
+ * @param value The ETH amount to send (in wei)
502
+ * @param proof The encoded proof data from encodeAllowlistProofData
503
+ * @returns Transaction configuration for buying into a presale with proof
504
+ */
505
+ declare function getBuyIntoPresaleWithProofTransaction({ presaleId, chainId, value, proof, }: {
506
+ presaleId: bigint;
507
+ chainId: Chain;
508
+ value: bigint;
509
+ proof: `0x${string}`;
510
+ }): ClankerTransactionConfig<typeof Clanker_PresaleEthToCreator_v4_1_abi, 'buyIntoPresaleWithProof'>;
511
+ /**
512
+ * Buy into a presale with allowlist proof
513
+ *
514
+ * Use this when buying into a presale that has an allowlist enabled.
515
+ * You must provide proof that your address is on the allowlist.
516
+ *
517
+ * @param clanker Clanker object used for buying into presale
518
+ * @param presaleId The ID of the presale
519
+ * @param ethAmount The ETH amount to send (in ETH, will be converted to wei)
520
+ * @param proof The encoded proof data from encodeAllowlistProofData
521
+ * @returns Outcome of the transaction
522
+ *
523
+ * @example
524
+ * ```typescript
525
+ * import { createAllowlistMerkleTree, getAllowlistMerkleProof, encodeAllowlistProofData } from '../utils/presale-allowlist';
526
+ *
527
+ * // Get your proof from the allowlist
528
+ * const { tree, entries } = createAllowlistMerkleTree(allowlistEntries);
529
+ * const proof = getAllowlistMerkleProof(tree, entries, buyerAddress, 1.0);
530
+ * const proofData = encodeAllowlistProofData(1.0, proof);
531
+ *
532
+ * // Buy with proof
533
+ * await buyIntoPresaleWithProof({ clanker, presaleId: 1n, ethAmount: 0.5, proof: proofData });
534
+ * ```
535
+ */
536
+ declare function buyIntoPresaleWithProof(data: {
537
+ clanker: Clanker;
538
+ presaleId: bigint;
539
+ ethAmount: number;
540
+ proof: `0x${string}`;
541
+ }): ClankerResult<{
542
+ txHash: `0x${string}`;
543
+ }>;
544
+
545
+ /**
546
+ * Get a transaction to set the merkle root for a presale allowlist
547
+ *
548
+ * Only callable by the presale owner. This allows updating the allowlist
549
+ * after the presale has been created.
550
+ *
551
+ * @param presaleId The presale ID
552
+ * @param merkleRoot The new merkle root
553
+ * @param chainId The chain ID
554
+ * @returns Transaction configuration
555
+ */
556
+ declare function getSetMerkleRootTransaction({ presaleId, merkleRoot, chainId, }: {
557
+ presaleId: bigint;
558
+ merkleRoot: `0x${string}`;
559
+ chainId: Chain;
560
+ }): ClankerTransactionConfig<typeof Clanker_PresaleAllowlist_v4_1_abi, 'setMerkleRoot'>;
561
+ /**
562
+ * Set the merkle root for a presale allowlist
563
+ *
564
+ * Only callable by the presale owner. This allows updating the allowlist
565
+ * after the presale has been created.
566
+ *
567
+ * @param clanker Clanker object
568
+ * @param presaleId The presale ID
569
+ * @param merkleRoot The new merkle root
570
+ * @returns Outcome of the transaction
571
+ */
572
+ declare function setMerkleRoot(data: {
573
+ clanker: Clanker;
574
+ presaleId: bigint;
575
+ merkleRoot: `0x${string}`;
576
+ }): ClankerResult<{
577
+ txHash: `0x${string}`;
578
+ }>;
579
+ /**
580
+ * Get a transaction to set an address override for a presale allowlist
581
+ *
582
+ * Only callable by the presale owner. Address overrides take precedence
583
+ * over the merkle tree allowlist. Setting allowedAmount to 0 effectively
584
+ * removes the override.
585
+ *
586
+ * @param presaleId The presale ID
587
+ * @param buyer The buyer's address to override
588
+ * @param allowedAmount The allowed amount in wei (0 to remove override)
589
+ * @param chainId The chain ID
590
+ * @returns Transaction configuration
591
+ */
592
+ declare function getSetAddressOverrideTransaction({ presaleId, buyer, allowedAmount, chainId, }: {
593
+ presaleId: bigint;
594
+ buyer: `0x${string}`;
595
+ allowedAmount: bigint;
596
+ chainId: Chain;
597
+ }): ClankerTransactionConfig<typeof Clanker_PresaleAllowlist_v4_1_abi, 'setAddressOverride'>;
598
+ /**
599
+ * Set an address override for a presale allowlist
600
+ *
601
+ * Only callable by the presale owner. Address overrides take precedence
602
+ * over the merkle tree allowlist. This is useful for manually adding
603
+ * addresses without regenerating the entire merkle tree.
604
+ *
605
+ * @param clanker Clanker object
606
+ * @param presaleId The presale ID
607
+ * @param buyer The buyer's address to override
608
+ * @param allowedAmountEth The allowed amount in ETH (0 to remove override)
609
+ * @returns Outcome of the transaction
610
+ *
611
+ * @example
612
+ * ```typescript
613
+ * // Allow a specific address to buy up to 2 ETH
614
+ * await setAddressOverride({
615
+ * clanker,
616
+ * presaleId: 1n,
617
+ * buyer: '0x123...',
618
+ * allowedAmountEth: 2.0
619
+ * });
620
+ *
621
+ * // Remove the override (set to 0)
622
+ * await setAddressOverride({
623
+ * clanker,
624
+ * presaleId: 1n,
625
+ * buyer: '0x123...',
626
+ * allowedAmountEth: 0
627
+ * });
628
+ * ```
629
+ */
630
+ declare function setAddressOverride(data: {
631
+ clanker: Clanker;
632
+ presaleId: bigint;
633
+ buyer: `0x${string}`;
634
+ allowedAmountEth: number;
635
+ }): ClankerResult<{
636
+ txHash: `0x${string}`;
637
+ }>;
638
+ /**
639
+ * Get a transaction to enable or disable the allowlist for a presale
640
+ *
641
+ * Only callable by the presale owner. When disabled, anyone can buy
642
+ * into the presale without restrictions. When enabled, buyers must
643
+ * provide proof or have an address override.
644
+ *
645
+ * @param presaleId The presale ID
646
+ * @param enabled Whether to enable or disable the allowlist
647
+ * @param chainId The chain ID
648
+ * @returns Transaction configuration
649
+ */
650
+ declare function getSetAllowlistEnabledTransaction({ presaleId, enabled, chainId, }: {
651
+ presaleId: bigint;
652
+ enabled: boolean;
653
+ chainId: Chain;
654
+ }): ClankerTransactionConfig<typeof Clanker_PresaleAllowlist_v4_1_abi, 'setAllowlistEnabled'>;
655
+ /**
656
+ * Enable or disable the allowlist for a presale
657
+ *
658
+ * Only callable by the presale owner. When disabled, anyone can buy
659
+ * into the presale without restrictions. When enabled, buyers must
660
+ * provide proof or have an address override.
661
+ *
662
+ * @param clanker Clanker object
663
+ * @param presaleId The presale ID
664
+ * @param enabled Whether to enable or disable the allowlist
665
+ * @returns Outcome of the transaction
666
+ *
667
+ * @example
668
+ * ```typescript
669
+ * // Disable the allowlist to let anyone participate
670
+ * await setAllowlistEnabled({ clanker, presaleId: 1n, enabled: false });
671
+ *
672
+ * // Re-enable the allowlist
673
+ * await setAllowlistEnabled({ clanker, presaleId: 1n, enabled: true });
674
+ * ```
675
+ */
676
+ declare function setAllowlistEnabled(data: {
677
+ clanker: Clanker;
678
+ presaleId: bigint;
679
+ enabled: boolean;
680
+ }): ClankerResult<{
681
+ txHash: `0x${string}`;
682
+ }>;
493
683
 
494
- export { type AirdropRecipient, type PresaleConfig, PresaleStatus, buyIntoPresale, claimAirdrop, claimEth, claimTokens, createAirdrop, endPresale, fetchAirdropProofs, getAirdropProofs, getAllowlistAddress, getAmountAvailableToClaim, getBuyIntoPresaleTransaction, getClaimAirdropTransaction, getClaimEthTransaction, getClaimTokensTransaction, getEndPresaleTransaction, getPresale, getPresaleBuys, getPresaleClaimed, getPresaleState, getStartPresaleTransaction, getWithdrawFromPresaleTransaction, registerAirdrop, startPresale, withdrawFromPresale };
684
+ export { type AirdropRecipient, type PresaleConfig, PresaleStatus, buyIntoPresale, buyIntoPresaleWithProof, claimAirdrop, claimEth, claimTokens, createAirdrop, endPresale, fetchAirdropProofs, getAirdropProofs, getAllowlistAddress, getAmountAvailableToClaim, getBuyIntoPresaleTransaction, getBuyIntoPresaleWithProofTransaction, getClaimAirdropTransaction, getClaimEthTransaction, getClaimTokensTransaction, getEndPresaleTransaction, getPresale, getPresaleBuys, getPresaleClaimed, getPresaleState, getSetAddressOverrideTransaction, getSetAllowlistEnabledTransaction, getSetMerkleRootTransaction, getStartPresaleTransaction, getWithdrawFromPresaleTransaction, registerAirdrop, setAddressOverride, setAllowlistEnabled, setMerkleRoot, startPresale, withdrawFromPresale };