@medialane/sdk 0.6.2 → 0.6.3
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 +0 -15
- package/dist/index.cjs +23 -547
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -599
- package/dist/index.d.ts +38 -599
- package/dist/index.js +25 -543
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { TypedDataRevision,
|
|
2
|
+
import { TypedDataRevision, shortString, cairo, Contract, constants, RpcProvider, byteArray, num } from 'starknet';
|
|
3
3
|
|
|
4
4
|
// src/config.ts
|
|
5
5
|
|
|
6
6
|
// src/constants.ts
|
|
7
7
|
var MARKETPLACE_CONTRACT_MAINNET = "0x04299b51289aa700de4ce19cc77bcea8430bfd1aef04193efab09d60a3a7ee0f";
|
|
8
8
|
var COLLECTION_CONTRACT_MAINNET = "0x05e73b7be06d82beeb390a0e0d655f2c9e7cf519658e04f05d9c690ccc41da03";
|
|
9
|
+
var DROP_FACTORY_CONTRACT_MAINNET = "0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800";
|
|
10
|
+
var POP_FACTORY_CONTRACT_MAINNET = "0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111";
|
|
9
11
|
var MARKETPLACE_CONTRACT_SEPOLIA = "";
|
|
10
12
|
var COLLECTION_CONTRACT_SEPOLIA = "";
|
|
11
13
|
var SUPPORTED_TOKENS = [
|
|
@@ -47,10 +49,6 @@ var DEFAULT_RPC_URLS = {
|
|
|
47
49
|
mainnet: "https://rpc.starknet.lava.build",
|
|
48
50
|
sepolia: "https://rpc.starknet-sepolia.lava.build"
|
|
49
51
|
};
|
|
50
|
-
var POP_FACTORY_CONTRACT_MAINNET = "0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111";
|
|
51
|
-
var POP_COLLECTION_CLASS_HASH_MAINNET = "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
|
|
52
|
-
var DROP_FACTORY_CONTRACT_MAINNET = "0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800";
|
|
53
|
-
var DROP_COLLECTION_CLASS_HASH_MAINNET = "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282";
|
|
54
52
|
|
|
55
53
|
// src/abis.ts
|
|
56
54
|
var IPMarketplaceABI = [
|
|
@@ -359,106 +357,43 @@ var IPMarketplaceABI = [
|
|
|
359
357
|
]
|
|
360
358
|
}
|
|
361
359
|
];
|
|
362
|
-
var
|
|
360
|
+
var DropFactoryABI = [
|
|
363
361
|
{
|
|
364
362
|
type: "struct",
|
|
365
|
-
name: "
|
|
363
|
+
name: "launchpad::types::ClaimConditions",
|
|
366
364
|
members: [
|
|
367
|
-
{ name: "
|
|
368
|
-
{ name: "
|
|
369
|
-
{ name: "
|
|
365
|
+
{ name: "start_time", type: "core::integer::u64" },
|
|
366
|
+
{ name: "end_time", type: "core::integer::u64" },
|
|
367
|
+
{ name: "price", type: "core::integer::u256" },
|
|
368
|
+
{ name: "payment_token", type: "core::starknet::contract_address::ContractAddress" },
|
|
369
|
+
{ name: "max_quantity_per_wallet", type: "core::integer::u256" }
|
|
370
370
|
]
|
|
371
371
|
},
|
|
372
372
|
{
|
|
373
373
|
type: "function",
|
|
374
|
-
name: "
|
|
375
|
-
inputs: [],
|
|
376
|
-
outputs: [],
|
|
377
|
-
state_mutability: "external"
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
type: "function",
|
|
381
|
-
name: "admin_mint",
|
|
382
|
-
inputs: [
|
|
383
|
-
{ name: "recipient", type: "core::starknet::contract_address::ContractAddress" },
|
|
384
|
-
{ name: "custom_uri", type: "core::byte_array::ByteArray" }
|
|
385
|
-
],
|
|
386
|
-
outputs: [],
|
|
387
|
-
state_mutability: "external"
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
type: "function",
|
|
391
|
-
name: "add_to_allowlist",
|
|
392
|
-
inputs: [{ name: "address", type: "core::starknet::contract_address::ContractAddress" }],
|
|
393
|
-
outputs: [],
|
|
394
|
-
state_mutability: "external"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
type: "function",
|
|
398
|
-
name: "batch_add_to_allowlist",
|
|
399
|
-
inputs: [{ name: "addresses", type: "core::array::Array::<core::starknet::contract_address::ContractAddress>" }],
|
|
400
|
-
outputs: [],
|
|
401
|
-
state_mutability: "external"
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
type: "function",
|
|
405
|
-
name: "remove_from_allowlist",
|
|
406
|
-
inputs: [{ name: "address", type: "core::starknet::contract_address::ContractAddress" }],
|
|
407
|
-
outputs: [],
|
|
408
|
-
state_mutability: "external"
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
type: "function",
|
|
412
|
-
name: "set_token_uri",
|
|
374
|
+
name: "create_drop",
|
|
413
375
|
inputs: [
|
|
414
|
-
{ name: "
|
|
415
|
-
{ name: "
|
|
376
|
+
{ name: "name", type: "core::byte_array::ByteArray" },
|
|
377
|
+
{ name: "symbol", type: "core::byte_array::ByteArray" },
|
|
378
|
+
{ name: "base_uri", type: "core::byte_array::ByteArray" },
|
|
379
|
+
{ name: "max_supply", type: "core::integer::u256" },
|
|
380
|
+
{ name: "claim_conditions", type: "launchpad::types::ClaimConditions" }
|
|
416
381
|
],
|
|
417
|
-
outputs: [],
|
|
418
|
-
state_mutability: "external"
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
type: "function",
|
|
422
|
-
name: "set_paused",
|
|
423
|
-
inputs: [{ name: "paused", type: "core::bool" }],
|
|
424
|
-
outputs: [],
|
|
382
|
+
outputs: [{ type: "core::starknet::contract_address::ContractAddress" }],
|
|
425
383
|
state_mutability: "external"
|
|
426
384
|
},
|
|
427
385
|
{
|
|
428
386
|
type: "function",
|
|
429
|
-
name: "
|
|
430
|
-
inputs: [{ name: "
|
|
431
|
-
outputs: [{ type: "core::bool" }],
|
|
432
|
-
state_mutability: "view"
|
|
433
|
-
},
|
|
434
|
-
{
|
|
435
|
-
type: "function",
|
|
436
|
-
name: "has_claimed",
|
|
437
|
-
inputs: [{ name: "address", type: "core::starknet::contract_address::ContractAddress" }],
|
|
387
|
+
name: "is_active_organizer",
|
|
388
|
+
inputs: [{ name: "organizer", type: "core::starknet::contract_address::ContractAddress" }],
|
|
438
389
|
outputs: [{ type: "core::bool" }],
|
|
439
390
|
state_mutability: "view"
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
type: "function",
|
|
443
|
-
name: "total_minted",
|
|
444
|
-
inputs: [],
|
|
445
|
-
outputs: [{ type: "core::integer::u256" }],
|
|
446
|
-
state_mutability: "view"
|
|
447
391
|
}
|
|
448
392
|
];
|
|
449
393
|
var POPFactoryABI = [
|
|
450
|
-
{
|
|
451
|
-
type: "struct",
|
|
452
|
-
name: "core::byte_array::ByteArray",
|
|
453
|
-
members: [
|
|
454
|
-
{ name: "data", type: "core::array::Array::<core::felt252>" },
|
|
455
|
-
{ name: "pending_word", type: "core::felt252" },
|
|
456
|
-
{ name: "pending_word_len", type: "core::integer::u32" }
|
|
457
|
-
]
|
|
458
|
-
},
|
|
459
394
|
{
|
|
460
395
|
type: "enum",
|
|
461
|
-
name: "
|
|
396
|
+
name: "launchpad::pop::EventType",
|
|
462
397
|
variants: [
|
|
463
398
|
{ name: "Conference", type: "()" },
|
|
464
399
|
{ name: "Bootcamp", type: "()" },
|
|
@@ -477,286 +412,19 @@ var POPFactoryABI = [
|
|
|
477
412
|
{ name: "symbol", type: "core::byte_array::ByteArray" },
|
|
478
413
|
{ name: "base_uri", type: "core::byte_array::ByteArray" },
|
|
479
414
|
{ name: "claim_end_time", type: "core::integer::u64" },
|
|
480
|
-
{ name: "event_type", type: "
|
|
415
|
+
{ name: "event_type", type: "launchpad::pop::EventType" }
|
|
481
416
|
],
|
|
482
417
|
outputs: [{ type: "core::starknet::contract_address::ContractAddress" }],
|
|
483
418
|
state_mutability: "external"
|
|
484
419
|
},
|
|
485
420
|
{
|
|
486
421
|
type: "function",
|
|
487
|
-
name: "
|
|
488
|
-
inputs: [
|
|
489
|
-
{ name: "provider", type: "core::starknet::contract_address::ContractAddress" },
|
|
490
|
-
{ name: "name", type: "core::byte_array::ByteArray" },
|
|
491
|
-
{ name: "website_url", type: "core::byte_array::ByteArray" }
|
|
492
|
-
],
|
|
493
|
-
outputs: [],
|
|
494
|
-
state_mutability: "external"
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
type: "function",
|
|
498
|
-
name: "set_pop_collection_class_hash",
|
|
499
|
-
inputs: [{ name: "new_class_hash", type: "core::starknet::class_hash::ClassHash" }],
|
|
500
|
-
outputs: [],
|
|
501
|
-
state_mutability: "external"
|
|
502
|
-
}
|
|
503
|
-
];
|
|
504
|
-
var DropCollectionABI = [
|
|
505
|
-
{
|
|
506
|
-
type: "struct",
|
|
507
|
-
name: "core::byte_array::ByteArray",
|
|
508
|
-
members: [
|
|
509
|
-
{ name: "data", type: "core::array::Array::<core::felt252>" },
|
|
510
|
-
{ name: "pending_word", type: "core::felt252" },
|
|
511
|
-
{ name: "pending_word_len", type: "core::integer::u32" }
|
|
512
|
-
]
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
type: "struct",
|
|
516
|
-
name: "collection_drop::types::ClaimConditions",
|
|
517
|
-
members: [
|
|
518
|
-
{ name: "start_time", type: "core::integer::u64" },
|
|
519
|
-
{ name: "end_time", type: "core::integer::u64" },
|
|
520
|
-
{ name: "price", type: "core::integer::u256" },
|
|
521
|
-
{ name: "payment_token", type: "core::starknet::contract_address::ContractAddress" },
|
|
522
|
-
{ name: "max_quantity_per_wallet", type: "core::integer::u256" }
|
|
523
|
-
]
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
type: "function",
|
|
527
|
-
name: "claim",
|
|
528
|
-
inputs: [{ name: "quantity", type: "core::integer::u256" }],
|
|
529
|
-
outputs: [],
|
|
530
|
-
state_mutability: "external"
|
|
531
|
-
},
|
|
532
|
-
{
|
|
533
|
-
type: "function",
|
|
534
|
-
name: "admin_mint",
|
|
535
|
-
inputs: [
|
|
536
|
-
{ name: "recipient", type: "core::starknet::contract_address::ContractAddress" },
|
|
537
|
-
{ name: "quantity", type: "core::integer::u256" },
|
|
538
|
-
{ name: "custom_uri", type: "core::byte_array::ByteArray" }
|
|
539
|
-
],
|
|
540
|
-
outputs: [],
|
|
541
|
-
state_mutability: "external"
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
type: "function",
|
|
545
|
-
name: "set_claim_conditions",
|
|
546
|
-
inputs: [{ name: "conditions", type: "collection_drop::types::ClaimConditions" }],
|
|
547
|
-
outputs: [],
|
|
548
|
-
state_mutability: "external"
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
type: "function",
|
|
552
|
-
name: "get_claim_conditions",
|
|
553
|
-
inputs: [],
|
|
554
|
-
outputs: [{ type: "collection_drop::types::ClaimConditions" }],
|
|
555
|
-
state_mutability: "view"
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
type: "function",
|
|
559
|
-
name: "set_allowlist_enabled",
|
|
560
|
-
inputs: [{ name: "enabled", type: "core::bool" }],
|
|
561
|
-
outputs: [],
|
|
562
|
-
state_mutability: "external"
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
type: "function",
|
|
566
|
-
name: "is_allowlist_enabled",
|
|
567
|
-
inputs: [],
|
|
568
|
-
outputs: [{ type: "core::bool" }],
|
|
569
|
-
state_mutability: "view"
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
type: "function",
|
|
573
|
-
name: "add_to_allowlist",
|
|
574
|
-
inputs: [{ name: "address", type: "core::starknet::contract_address::ContractAddress" }],
|
|
575
|
-
outputs: [],
|
|
576
|
-
state_mutability: "external"
|
|
577
|
-
},
|
|
578
|
-
{
|
|
579
|
-
type: "function",
|
|
580
|
-
name: "batch_add_to_allowlist",
|
|
581
|
-
inputs: [{ name: "addresses", type: "core::array::Array::<core::starknet::contract_address::ContractAddress>" }],
|
|
582
|
-
outputs: [],
|
|
583
|
-
state_mutability: "external"
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
type: "function",
|
|
587
|
-
name: "remove_from_allowlist",
|
|
588
|
-
inputs: [{ name: "address", type: "core::starknet::contract_address::ContractAddress" }],
|
|
589
|
-
outputs: [],
|
|
590
|
-
state_mutability: "external"
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
type: "function",
|
|
594
|
-
name: "is_allowlisted",
|
|
595
|
-
inputs: [{ name: "address", type: "core::starknet::contract_address::ContractAddress" }],
|
|
596
|
-
outputs: [{ type: "core::bool" }],
|
|
597
|
-
state_mutability: "view"
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
type: "function",
|
|
601
|
-
name: "set_base_uri",
|
|
602
|
-
inputs: [{ name: "new_uri", type: "core::byte_array::ByteArray" }],
|
|
603
|
-
outputs: [],
|
|
604
|
-
state_mutability: "external"
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
type: "function",
|
|
608
|
-
name: "set_token_uri",
|
|
609
|
-
inputs: [
|
|
610
|
-
{ name: "token_id", type: "core::integer::u256" },
|
|
611
|
-
{ name: "uri", type: "core::byte_array::ByteArray" }
|
|
612
|
-
],
|
|
613
|
-
outputs: [],
|
|
614
|
-
state_mutability: "external"
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
type: "function",
|
|
618
|
-
name: "set_paused",
|
|
619
|
-
inputs: [{ name: "paused", type: "core::bool" }],
|
|
620
|
-
outputs: [],
|
|
621
|
-
state_mutability: "external"
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
type: "function",
|
|
625
|
-
name: "withdraw_payments",
|
|
626
|
-
inputs: [],
|
|
627
|
-
outputs: [],
|
|
628
|
-
state_mutability: "external"
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
type: "function",
|
|
632
|
-
name: "get_drop_id",
|
|
633
|
-
inputs: [],
|
|
634
|
-
outputs: [{ type: "core::integer::u256" }],
|
|
635
|
-
state_mutability: "view"
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
type: "function",
|
|
639
|
-
name: "get_max_supply",
|
|
640
|
-
inputs: [],
|
|
641
|
-
outputs: [{ type: "core::integer::u256" }],
|
|
642
|
-
state_mutability: "view"
|
|
643
|
-
},
|
|
644
|
-
{
|
|
645
|
-
type: "function",
|
|
646
|
-
name: "total_minted",
|
|
647
|
-
inputs: [],
|
|
648
|
-
outputs: [{ type: "core::integer::u256" }],
|
|
649
|
-
state_mutability: "view"
|
|
650
|
-
},
|
|
651
|
-
{
|
|
652
|
-
type: "function",
|
|
653
|
-
name: "remaining_supply",
|
|
654
|
-
inputs: [],
|
|
655
|
-
outputs: [{ type: "core::integer::u256" }],
|
|
656
|
-
state_mutability: "view"
|
|
657
|
-
},
|
|
658
|
-
{
|
|
659
|
-
type: "function",
|
|
660
|
-
name: "minted_by_wallet",
|
|
661
|
-
inputs: [{ name: "wallet", type: "core::starknet::contract_address::ContractAddress" }],
|
|
662
|
-
outputs: [{ type: "core::integer::u256" }],
|
|
663
|
-
state_mutability: "view"
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
type: "function",
|
|
667
|
-
name: "is_paused",
|
|
668
|
-
inputs: [],
|
|
422
|
+
name: "is_active_provider",
|
|
423
|
+
inputs: [{ name: "provider", type: "core::starknet::contract_address::ContractAddress" }],
|
|
669
424
|
outputs: [{ type: "core::bool" }],
|
|
670
425
|
state_mutability: "view"
|
|
671
426
|
}
|
|
672
427
|
];
|
|
673
|
-
var DropFactoryABI = [
|
|
674
|
-
{
|
|
675
|
-
type: "struct",
|
|
676
|
-
name: "core::byte_array::ByteArray",
|
|
677
|
-
members: [
|
|
678
|
-
{ name: "data", type: "core::array::Array::<core::felt252>" },
|
|
679
|
-
{ name: "pending_word", type: "core::felt252" },
|
|
680
|
-
{ name: "pending_word_len", type: "core::integer::u32" }
|
|
681
|
-
]
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
type: "struct",
|
|
685
|
-
name: "collection_drop::types::ClaimConditions",
|
|
686
|
-
members: [
|
|
687
|
-
{ name: "start_time", type: "core::integer::u64" },
|
|
688
|
-
{ name: "end_time", type: "core::integer::u64" },
|
|
689
|
-
{ name: "price", type: "core::integer::u256" },
|
|
690
|
-
{ name: "payment_token", type: "core::starknet::contract_address::ContractAddress" },
|
|
691
|
-
{ name: "max_quantity_per_wallet", type: "core::integer::u256" }
|
|
692
|
-
]
|
|
693
|
-
},
|
|
694
|
-
{
|
|
695
|
-
type: "function",
|
|
696
|
-
name: "register_organizer",
|
|
697
|
-
inputs: [
|
|
698
|
-
{ name: "organizer", type: "core::starknet::contract_address::ContractAddress" },
|
|
699
|
-
{ name: "name", type: "core::byte_array::ByteArray" }
|
|
700
|
-
],
|
|
701
|
-
outputs: [],
|
|
702
|
-
state_mutability: "external"
|
|
703
|
-
},
|
|
704
|
-
{
|
|
705
|
-
type: "function",
|
|
706
|
-
name: "revoke_organizer",
|
|
707
|
-
inputs: [{ name: "organizer", type: "core::starknet::contract_address::ContractAddress" }],
|
|
708
|
-
outputs: [],
|
|
709
|
-
state_mutability: "external"
|
|
710
|
-
},
|
|
711
|
-
{
|
|
712
|
-
type: "function",
|
|
713
|
-
name: "is_active_organizer",
|
|
714
|
-
inputs: [{ name: "organizer", type: "core::starknet::contract_address::ContractAddress" }],
|
|
715
|
-
outputs: [{ type: "core::bool" }],
|
|
716
|
-
state_mutability: "view"
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
type: "function",
|
|
720
|
-
name: "create_drop",
|
|
721
|
-
inputs: [
|
|
722
|
-
{ name: "name", type: "core::byte_array::ByteArray" },
|
|
723
|
-
{ name: "symbol", type: "core::byte_array::ByteArray" },
|
|
724
|
-
{ name: "base_uri", type: "core::byte_array::ByteArray" },
|
|
725
|
-
{ name: "max_supply", type: "core::integer::u256" },
|
|
726
|
-
{ name: "initial_conditions", type: "collection_drop::types::ClaimConditions" }
|
|
727
|
-
],
|
|
728
|
-
outputs: [{ type: "core::starknet::contract_address::ContractAddress" }],
|
|
729
|
-
state_mutability: "external"
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
type: "function",
|
|
733
|
-
name: "get_drop_address",
|
|
734
|
-
inputs: [{ name: "drop_id", type: "core::integer::u256" }],
|
|
735
|
-
outputs: [{ type: "core::starknet::contract_address::ContractAddress" }],
|
|
736
|
-
state_mutability: "view"
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
type: "function",
|
|
740
|
-
name: "get_last_drop_id",
|
|
741
|
-
inputs: [],
|
|
742
|
-
outputs: [{ type: "core::integer::u256" }],
|
|
743
|
-
state_mutability: "view"
|
|
744
|
-
},
|
|
745
|
-
{
|
|
746
|
-
type: "function",
|
|
747
|
-
name: "get_organizer_drop_count",
|
|
748
|
-
inputs: [{ name: "organizer", type: "core::starknet::contract_address::ContractAddress" }],
|
|
749
|
-
outputs: [{ type: "core::integer::u32" }],
|
|
750
|
-
state_mutability: "view"
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
type: "function",
|
|
754
|
-
name: "set_drop_collection_class_hash",
|
|
755
|
-
inputs: [{ name: "new_class_hash", type: "core::starknet::class_hash::ClassHash" }],
|
|
756
|
-
outputs: [],
|
|
757
|
-
state_mutability: "external"
|
|
758
|
-
}
|
|
759
|
-
];
|
|
760
428
|
|
|
761
429
|
// src/utils/bigint.ts
|
|
762
430
|
function stringifyBigInts(obj) {
|
|
@@ -1473,11 +1141,10 @@ var ApiClient = class {
|
|
|
1473
1141
|
);
|
|
1474
1142
|
}
|
|
1475
1143
|
// ─── Collections ───────────────────────────────────────────────────────────
|
|
1476
|
-
getCollections(page = 1, limit = 20, isKnown, sort
|
|
1144
|
+
getCollections(page = 1, limit = 20, isKnown, sort) {
|
|
1477
1145
|
const params = new URLSearchParams({ page: String(page), limit: String(limit) });
|
|
1478
1146
|
if (isKnown !== void 0) params.set("isKnown", String(isKnown));
|
|
1479
1147
|
if (sort) params.set("sort", sort);
|
|
1480
|
-
if (source) params.set("source", source);
|
|
1481
1148
|
return this.get(`/v1/collections?${params}`);
|
|
1482
1149
|
}
|
|
1483
1150
|
getCollectionsByOwner(owner, page = 1, limit = 50) {
|
|
@@ -1672,14 +1339,6 @@ var ApiClient = class {
|
|
|
1672
1339
|
});
|
|
1673
1340
|
return res.json();
|
|
1674
1341
|
}
|
|
1675
|
-
async getGatedContent(contractAddress, clerkToken) {
|
|
1676
|
-
const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collections/${normalizeAddress(contractAddress)}/gated-content`;
|
|
1677
|
-
const res = await fetch(url, {
|
|
1678
|
-
headers: { ...this.baseHeaders, "Authorization": `Bearer ${clerkToken}` }
|
|
1679
|
-
});
|
|
1680
|
-
if (res.status === 403 || res.status === 404) return null;
|
|
1681
|
-
return res.json();
|
|
1682
|
-
}
|
|
1683
1342
|
// ─── Creator Profiles ───────────────────────────────────────────────────────
|
|
1684
1343
|
/** List all creators with an approved username. */
|
|
1685
1344
|
async getCreators(opts = {}) {
|
|
@@ -1849,179 +1508,6 @@ var ApiClient = class {
|
|
|
1849
1508
|
headers: { "Authorization": `Bearer ${clerkToken}` }
|
|
1850
1509
|
});
|
|
1851
1510
|
}
|
|
1852
|
-
// ─── POP Protocol ──────────────────────────────────────────────────────────
|
|
1853
|
-
getPopCollections(opts = {}) {
|
|
1854
|
-
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "POP_PROTOCOL");
|
|
1855
|
-
}
|
|
1856
|
-
async getPopEligibility(collection, wallet) {
|
|
1857
|
-
const res = await this.get(
|
|
1858
|
-
`/v1/pop/eligibility/${normalizeAddress(collection)}/${normalizeAddress(wallet)}`
|
|
1859
|
-
);
|
|
1860
|
-
return res.data;
|
|
1861
|
-
}
|
|
1862
|
-
async getPopEligibilityBatch(collection, wallets) {
|
|
1863
|
-
const params = new URLSearchParams({ wallets: wallets.map(normalizeAddress).join(",") });
|
|
1864
|
-
const res = await this.get(
|
|
1865
|
-
`/v1/pop/eligibility/${normalizeAddress(collection)}?${params}`
|
|
1866
|
-
);
|
|
1867
|
-
return res.data;
|
|
1868
|
-
}
|
|
1869
|
-
// ─── Collection Drop ────────────────────────────────────────────────────────
|
|
1870
|
-
getDropCollections(opts = {}) {
|
|
1871
|
-
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "COLLECTION_DROP");
|
|
1872
|
-
}
|
|
1873
|
-
async getDropMintStatus(collection, wallet) {
|
|
1874
|
-
const res = await this.get(
|
|
1875
|
-
`/v1/drop/mint-status/${normalizeAddress(collection)}/${normalizeAddress(wallet)}`
|
|
1876
|
-
);
|
|
1877
|
-
return res.data;
|
|
1878
|
-
}
|
|
1879
|
-
};
|
|
1880
|
-
var PopService = class {
|
|
1881
|
-
constructor(_config) {
|
|
1882
|
-
this.factoryAddress = POP_FACTORY_CONTRACT_MAINNET;
|
|
1883
|
-
}
|
|
1884
|
-
_collection(address, account) {
|
|
1885
|
-
return new Contract(POPCollectionABI, normalizeAddress(address), account);
|
|
1886
|
-
}
|
|
1887
|
-
async claim(account, collectionAddress) {
|
|
1888
|
-
const call = this._collection(collectionAddress, account).populate("claim", []);
|
|
1889
|
-
const res = await account.execute([call]);
|
|
1890
|
-
return { txHash: res.transaction_hash };
|
|
1891
|
-
}
|
|
1892
|
-
async adminMint(account, params) {
|
|
1893
|
-
const call = this._collection(params.collection, account).populate("admin_mint", [
|
|
1894
|
-
params.recipient,
|
|
1895
|
-
params.customUri ?? ""
|
|
1896
|
-
]);
|
|
1897
|
-
const res = await account.execute([call]);
|
|
1898
|
-
return { txHash: res.transaction_hash };
|
|
1899
|
-
}
|
|
1900
|
-
async addToAllowlist(account, params) {
|
|
1901
|
-
const call = this._collection(params.collection, account).populate("add_to_allowlist", [params.address]);
|
|
1902
|
-
const res = await account.execute([call]);
|
|
1903
|
-
return { txHash: res.transaction_hash };
|
|
1904
|
-
}
|
|
1905
|
-
async batchAddToAllowlist(account, params) {
|
|
1906
|
-
const collection = this._collection(params.collection, account);
|
|
1907
|
-
const CHUNK = 200;
|
|
1908
|
-
const calls = [];
|
|
1909
|
-
for (let i = 0; i < params.addresses.length; i += CHUNK) {
|
|
1910
|
-
calls.push(collection.populate("batch_add_to_allowlist", [params.addresses.slice(i, i + CHUNK)]));
|
|
1911
|
-
}
|
|
1912
|
-
const res = await account.execute(calls);
|
|
1913
|
-
return { txHash: res.transaction_hash };
|
|
1914
|
-
}
|
|
1915
|
-
async removeFromAllowlist(account, params) {
|
|
1916
|
-
const call = this._collection(params.collection, account).populate("remove_from_allowlist", [params.address]);
|
|
1917
|
-
const res = await account.execute([call]);
|
|
1918
|
-
return { txHash: res.transaction_hash };
|
|
1919
|
-
}
|
|
1920
|
-
async setTokenUri(account, params) {
|
|
1921
|
-
const call = this._collection(params.collection, account).populate("set_token_uri", [
|
|
1922
|
-
BigInt(params.tokenId),
|
|
1923
|
-
params.uri
|
|
1924
|
-
]);
|
|
1925
|
-
const res = await account.execute([call]);
|
|
1926
|
-
return { txHash: res.transaction_hash };
|
|
1927
|
-
}
|
|
1928
|
-
async setPaused(account, params) {
|
|
1929
|
-
const call = this._collection(params.collection, account).populate("set_paused", [params.paused]);
|
|
1930
|
-
const res = await account.execute([call]);
|
|
1931
|
-
return { txHash: res.transaction_hash };
|
|
1932
|
-
}
|
|
1933
|
-
async createCollection(account, params) {
|
|
1934
|
-
const factory = new Contract(POPFactoryABI, this.factoryAddress, account);
|
|
1935
|
-
const call = factory.populate("create_collection", [
|
|
1936
|
-
params.name,
|
|
1937
|
-
params.symbol,
|
|
1938
|
-
params.baseUri,
|
|
1939
|
-
params.claimEndTime,
|
|
1940
|
-
{ [params.eventType]: {} }
|
|
1941
|
-
]);
|
|
1942
|
-
const res = await account.execute([call]);
|
|
1943
|
-
return { txHash: res.transaction_hash };
|
|
1944
|
-
}
|
|
1945
|
-
};
|
|
1946
|
-
function toContractConditions(c) {
|
|
1947
|
-
return {
|
|
1948
|
-
start_time: c.startTime,
|
|
1949
|
-
end_time: c.endTime,
|
|
1950
|
-
price: BigInt(c.price),
|
|
1951
|
-
payment_token: c.paymentToken,
|
|
1952
|
-
max_quantity_per_wallet: BigInt(c.maxQuantityPerWallet)
|
|
1953
|
-
};
|
|
1954
|
-
}
|
|
1955
|
-
var DropService = class {
|
|
1956
|
-
constructor(_config) {
|
|
1957
|
-
this.factoryAddress = DROP_FACTORY_CONTRACT_MAINNET;
|
|
1958
|
-
}
|
|
1959
|
-
_collection(address, account) {
|
|
1960
|
-
return new Contract(DropCollectionABI, normalizeAddress(address), account);
|
|
1961
|
-
}
|
|
1962
|
-
async claim(account, collectionAddress, quantity = 1) {
|
|
1963
|
-
const call = this._collection(collectionAddress, account).populate("claim", [BigInt(quantity)]);
|
|
1964
|
-
const res = await account.execute([call]);
|
|
1965
|
-
return { txHash: res.transaction_hash };
|
|
1966
|
-
}
|
|
1967
|
-
async adminMint(account, params) {
|
|
1968
|
-
const call = this._collection(params.collection, account).populate("admin_mint", [
|
|
1969
|
-
params.recipient,
|
|
1970
|
-
BigInt(params.quantity ?? 1),
|
|
1971
|
-
params.customUri ?? ""
|
|
1972
|
-
]);
|
|
1973
|
-
const res = await account.execute([call]);
|
|
1974
|
-
return { txHash: res.transaction_hash };
|
|
1975
|
-
}
|
|
1976
|
-
async setClaimConditions(account, params) {
|
|
1977
|
-
const call = this._collection(params.collection, account).populate("set_claim_conditions", [
|
|
1978
|
-
toContractConditions(params.conditions)
|
|
1979
|
-
]);
|
|
1980
|
-
const res = await account.execute([call]);
|
|
1981
|
-
return { txHash: res.transaction_hash };
|
|
1982
|
-
}
|
|
1983
|
-
async setAllowlistEnabled(account, params) {
|
|
1984
|
-
const call = this._collection(params.collection, account).populate("set_allowlist_enabled", [params.enabled]);
|
|
1985
|
-
const res = await account.execute([call]);
|
|
1986
|
-
return { txHash: res.transaction_hash };
|
|
1987
|
-
}
|
|
1988
|
-
async addToAllowlist(account, params) {
|
|
1989
|
-
const call = this._collection(params.collection, account).populate("add_to_allowlist", [params.address]);
|
|
1990
|
-
const res = await account.execute([call]);
|
|
1991
|
-
return { txHash: res.transaction_hash };
|
|
1992
|
-
}
|
|
1993
|
-
async batchAddToAllowlist(account, params) {
|
|
1994
|
-
const collection = this._collection(params.collection, account);
|
|
1995
|
-
const CHUNK = 200;
|
|
1996
|
-
const calls = [];
|
|
1997
|
-
for (let i = 0; i < params.addresses.length; i += CHUNK) {
|
|
1998
|
-
calls.push(collection.populate("batch_add_to_allowlist", [params.addresses.slice(i, i + CHUNK)]));
|
|
1999
|
-
}
|
|
2000
|
-
const res = await account.execute(calls);
|
|
2001
|
-
return { txHash: res.transaction_hash };
|
|
2002
|
-
}
|
|
2003
|
-
async setPaused(account, params) {
|
|
2004
|
-
const call = this._collection(params.collection, account).populate("set_paused", [params.paused]);
|
|
2005
|
-
const res = await account.execute([call]);
|
|
2006
|
-
return { txHash: res.transaction_hash };
|
|
2007
|
-
}
|
|
2008
|
-
async withdrawPayments(account, params) {
|
|
2009
|
-
const call = this._collection(params.collection, account).populate("withdraw_payments", []);
|
|
2010
|
-
const res = await account.execute([call]);
|
|
2011
|
-
return { txHash: res.transaction_hash };
|
|
2012
|
-
}
|
|
2013
|
-
async createDrop(account, params) {
|
|
2014
|
-
const factory = new Contract(DropFactoryABI, this.factoryAddress, account);
|
|
2015
|
-
const call = factory.populate("create_drop", [
|
|
2016
|
-
params.name,
|
|
2017
|
-
params.symbol,
|
|
2018
|
-
params.baseUri,
|
|
2019
|
-
BigInt(params.maxSupply),
|
|
2020
|
-
toContractConditions(params.initialConditions)
|
|
2021
|
-
]);
|
|
2022
|
-
const res = await account.execute([call]);
|
|
2023
|
-
return { txHash: res.transaction_hash };
|
|
2024
|
-
}
|
|
2025
1511
|
};
|
|
2026
1512
|
|
|
2027
1513
|
// src/client.ts
|
|
@@ -2029,10 +1515,6 @@ var MedialaneClient = class {
|
|
|
2029
1515
|
constructor(rawConfig = {}) {
|
|
2030
1516
|
this.config = resolveConfig(rawConfig);
|
|
2031
1517
|
this.marketplace = new MarketplaceModule(this.config);
|
|
2032
|
-
this.services = {
|
|
2033
|
-
pop: new PopService(this.config),
|
|
2034
|
-
drop: new DropService(this.config)
|
|
2035
|
-
};
|
|
2036
1518
|
if (!this.config.backendUrl) {
|
|
2037
1519
|
this.api = new Proxy({}, {
|
|
2038
1520
|
get(_target, prop) {
|
|
@@ -2061,6 +1543,6 @@ var MedialaneClient = class {
|
|
|
2061
1543
|
// src/types/api.ts
|
|
2062
1544
|
var OPEN_LICENSES = ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
|
|
2063
1545
|
|
|
2064
|
-
export { ApiClient, COLLECTION_CONTRACT_MAINNET, DEFAULT_RPC_URLS,
|
|
1546
|
+
export { ApiClient, COLLECTION_CONTRACT_MAINNET, DEFAULT_RPC_URLS, DROP_FACTORY_CONTRACT_MAINNET, DropFactoryABI, IPMarketplaceABI, MARKETPLACE_CONTRACT_MAINNET, MarketplaceModule, MedialaneApiError, MedialaneClient, MedialaneError, OPEN_LICENSES, POPFactoryABI, POP_FACTORY_CONTRACT_MAINNET, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
2065
1547
|
//# sourceMappingURL=index.js.map
|
|
2066
1548
|
//# sourceMappingURL=index.js.map
|