@provable-games/budokan-sdk 0.1.12 → 0.1.15

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/react.cjs CHANGED
@@ -588,15 +588,15 @@ var CHAINS = {
588
588
  rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
589
589
  apiBaseUrl: "https://budokan-api-production.up.railway.app",
590
590
  wsUrl: "wss://budokan-api-production.up.railway.app/ws",
591
- budokanAddress: "0x0124745dd41f3ad57e451b05a2d4db9bedaad351ac7643e552171aa5b0816c7a",
592
- viewerAddress: "0x07eaa10078ef122cf55bbb39de8a999c7269946208e016627f41674b7cfe944f"
591
+ budokanAddress: "0x0765e6f07c1a5cebe08aba7f840741242dffb1ed77ac619120501f540ec9a52a",
592
+ viewerAddress: "0x0232fb32bd06e38f3555000f255c01812198418d5fced3b6246900725bf2f4d1"
593
593
  },
594
594
  sepolia: {
595
595
  rpcUrl: "https://starknet-sepolia.public.blastapi.io",
596
596
  apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
597
597
  wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
598
- budokanAddress: "0x02a97de0b33fb115f5c32a58232d9941c4a5b2598aa71d30c094076cc592f94d",
599
- viewerAddress: "0x001f2be7ed811bfa859f8f6cf72d2458f36103ac172ff8e65a630bbcc6cf98c9"
598
+ budokanAddress: "0x0105573bf9184f0a3da78dda70a87055e6aafc7b3fb6e331732a0d25675b7be5",
599
+ viewerAddress: "0x0414fe2f48db1e3598a83f017d17b4d06cec180b160141fea9244054267c1ff1"
600
600
  }
601
601
  };
602
602
  function getChainConfig(chain) {
@@ -2391,6 +2391,1866 @@ var budokanViewer_default = [
2391
2391
  }
2392
2392
  ];
2393
2393
 
2394
+ // src/rpc/abis/budokan.json
2395
+ var budokan_default = [
2396
+ {
2397
+ type: "impl",
2398
+ name: "UpgradeableImpl",
2399
+ interface_name: "openzeppelin_interfaces::upgrades::IUpgradeable"
2400
+ },
2401
+ {
2402
+ type: "interface",
2403
+ name: "openzeppelin_interfaces::upgrades::IUpgradeable",
2404
+ items: [
2405
+ {
2406
+ type: "function",
2407
+ name: "upgrade",
2408
+ inputs: [
2409
+ {
2410
+ name: "new_class_hash",
2411
+ type: "core::starknet::class_hash::ClassHash"
2412
+ }
2413
+ ],
2414
+ outputs: [],
2415
+ state_mutability: "external"
2416
+ }
2417
+ ]
2418
+ },
2419
+ {
2420
+ type: "impl",
2421
+ name: "GameContextImpl",
2422
+ interface_name: "game_components_interfaces::metagame::context::IMetagameContext"
2423
+ },
2424
+ {
2425
+ type: "enum",
2426
+ name: "core::bool",
2427
+ variants: [
2428
+ {
2429
+ name: "False",
2430
+ type: "()"
2431
+ },
2432
+ {
2433
+ name: "True",
2434
+ type: "()"
2435
+ }
2436
+ ]
2437
+ },
2438
+ {
2439
+ type: "interface",
2440
+ name: "game_components_interfaces::metagame::context::IMetagameContext",
2441
+ items: [
2442
+ {
2443
+ type: "function",
2444
+ name: "has_context",
2445
+ inputs: [
2446
+ {
2447
+ name: "token_id",
2448
+ type: "core::felt252"
2449
+ }
2450
+ ],
2451
+ outputs: [
2452
+ {
2453
+ type: "core::bool"
2454
+ }
2455
+ ],
2456
+ state_mutability: "view"
2457
+ }
2458
+ ]
2459
+ },
2460
+ {
2461
+ type: "impl",
2462
+ name: "GameContextDetailsImpl",
2463
+ interface_name: "game_components_interfaces::metagame::context::IMetagameContextDetails"
2464
+ },
2465
+ {
2466
+ type: "struct",
2467
+ name: "core::byte_array::ByteArray",
2468
+ members: [
2469
+ {
2470
+ name: "data",
2471
+ type: "core::array::Array::<core::bytes_31::bytes31>"
2472
+ },
2473
+ {
2474
+ name: "pending_word",
2475
+ type: "core::felt252"
2476
+ },
2477
+ {
2478
+ name: "pending_word_len",
2479
+ type: "core::internal::bounded_int::BoundedInt::<0, 30>"
2480
+ }
2481
+ ]
2482
+ },
2483
+ {
2484
+ type: "enum",
2485
+ name: "core::option::Option::<core::integer::u32>",
2486
+ variants: [
2487
+ {
2488
+ name: "Some",
2489
+ type: "core::integer::u32"
2490
+ },
2491
+ {
2492
+ name: "None",
2493
+ type: "()"
2494
+ }
2495
+ ]
2496
+ },
2497
+ {
2498
+ type: "struct",
2499
+ name: "game_components_interfaces::structs::metagame::GameContext",
2500
+ members: [
2501
+ {
2502
+ name: "name",
2503
+ type: "core::byte_array::ByteArray"
2504
+ },
2505
+ {
2506
+ name: "value",
2507
+ type: "core::byte_array::ByteArray"
2508
+ }
2509
+ ]
2510
+ },
2511
+ {
2512
+ type: "struct",
2513
+ name: "core::array::Span::<game_components_interfaces::structs::metagame::GameContext>",
2514
+ members: [
2515
+ {
2516
+ name: "snapshot",
2517
+ type: "@core::array::Array::<game_components_interfaces::structs::metagame::GameContext>"
2518
+ }
2519
+ ]
2520
+ },
2521
+ {
2522
+ type: "struct",
2523
+ name: "game_components_interfaces::structs::metagame::GameContextDetails",
2524
+ members: [
2525
+ {
2526
+ name: "name",
2527
+ type: "core::byte_array::ByteArray"
2528
+ },
2529
+ {
2530
+ name: "description",
2531
+ type: "core::byte_array::ByteArray"
2532
+ },
2533
+ {
2534
+ name: "id",
2535
+ type: "core::option::Option::<core::integer::u32>"
2536
+ },
2537
+ {
2538
+ name: "context",
2539
+ type: "core::array::Span::<game_components_interfaces::structs::metagame::GameContext>"
2540
+ }
2541
+ ]
2542
+ },
2543
+ {
2544
+ type: "interface",
2545
+ name: "game_components_interfaces::metagame::context::IMetagameContextDetails",
2546
+ items: [
2547
+ {
2548
+ type: "function",
2549
+ name: "context_details",
2550
+ inputs: [
2551
+ {
2552
+ name: "token_id",
2553
+ type: "core::felt252"
2554
+ }
2555
+ ],
2556
+ outputs: [
2557
+ {
2558
+ type: "game_components_interfaces::structs::metagame::GameContextDetails"
2559
+ }
2560
+ ],
2561
+ state_mutability: "view"
2562
+ }
2563
+ ]
2564
+ },
2565
+ {
2566
+ type: "impl",
2567
+ name: "BudokanImpl",
2568
+ interface_name: "budokan_interfaces::budokan::IBudokan"
2569
+ },
2570
+ {
2571
+ type: "struct",
2572
+ name: "budokan_interfaces::budokan::Metadata",
2573
+ members: [
2574
+ {
2575
+ name: "name",
2576
+ type: "core::felt252"
2577
+ },
2578
+ {
2579
+ name: "description",
2580
+ type: "core::byte_array::ByteArray"
2581
+ }
2582
+ ]
2583
+ },
2584
+ {
2585
+ type: "struct",
2586
+ name: "budokan_interfaces::budokan::Schedule",
2587
+ members: [
2588
+ {
2589
+ name: "registration_start_delay",
2590
+ type: "core::integer::u32"
2591
+ },
2592
+ {
2593
+ name: "registration_end_delay",
2594
+ type: "core::integer::u32"
2595
+ },
2596
+ {
2597
+ name: "game_start_delay",
2598
+ type: "core::integer::u32"
2599
+ },
2600
+ {
2601
+ name: "game_end_delay",
2602
+ type: "core::integer::u32"
2603
+ },
2604
+ {
2605
+ name: "submission_duration",
2606
+ type: "core::integer::u32"
2607
+ }
2608
+ ]
2609
+ },
2610
+ {
2611
+ type: "enum",
2612
+ name: "core::option::Option::<core::byte_array::ByteArray>",
2613
+ variants: [
2614
+ {
2615
+ name: "Some",
2616
+ type: "core::byte_array::ByteArray"
2617
+ },
2618
+ {
2619
+ name: "None",
2620
+ type: "()"
2621
+ }
2622
+ ]
2623
+ },
2624
+ {
2625
+ type: "enum",
2626
+ name: "core::option::Option::<core::starknet::contract_address::ContractAddress>",
2627
+ variants: [
2628
+ {
2629
+ name: "Some",
2630
+ type: "core::starknet::contract_address::ContractAddress"
2631
+ },
2632
+ {
2633
+ name: "None",
2634
+ type: "()"
2635
+ }
2636
+ ]
2637
+ },
2638
+ {
2639
+ type: "struct",
2640
+ name: "budokan_interfaces::budokan::GameConfig",
2641
+ members: [
2642
+ {
2643
+ name: "game_address",
2644
+ type: "core::starknet::contract_address::ContractAddress"
2645
+ },
2646
+ {
2647
+ name: "settings_id",
2648
+ type: "core::integer::u32"
2649
+ },
2650
+ {
2651
+ name: "soulbound",
2652
+ type: "core::bool"
2653
+ },
2654
+ {
2655
+ name: "paymaster",
2656
+ type: "core::bool"
2657
+ },
2658
+ {
2659
+ name: "client_url",
2660
+ type: "core::option::Option::<core::byte_array::ByteArray>"
2661
+ },
2662
+ {
2663
+ name: "renderer",
2664
+ type: "core::option::Option::<core::starknet::contract_address::ContractAddress>"
2665
+ }
2666
+ ]
2667
+ },
2668
+ {
2669
+ type: "struct",
2670
+ name: "core::array::Span::<core::integer::u16>",
2671
+ members: [
2672
+ {
2673
+ name: "snapshot",
2674
+ type: "@core::array::Array::<core::integer::u16>"
2675
+ }
2676
+ ]
2677
+ },
2678
+ {
2679
+ type: "enum",
2680
+ name: "game_components_interfaces::distribution::Distribution",
2681
+ variants: [
2682
+ {
2683
+ name: "Linear",
2684
+ type: "core::integer::u16"
2685
+ },
2686
+ {
2687
+ name: "Exponential",
2688
+ type: "core::integer::u16"
2689
+ },
2690
+ {
2691
+ name: "Uniform",
2692
+ type: "()"
2693
+ },
2694
+ {
2695
+ name: "Custom",
2696
+ type: "core::array::Span::<core::integer::u16>"
2697
+ }
2698
+ ]
2699
+ },
2700
+ {
2701
+ type: "struct",
2702
+ name: "budokan_interfaces::budokan::EntryFee",
2703
+ members: [
2704
+ {
2705
+ name: "token_address",
2706
+ type: "core::starknet::contract_address::ContractAddress"
2707
+ },
2708
+ {
2709
+ name: "amount",
2710
+ type: "core::integer::u128"
2711
+ },
2712
+ {
2713
+ name: "tournament_creator_share",
2714
+ type: "core::integer::u16"
2715
+ },
2716
+ {
2717
+ name: "game_creator_share",
2718
+ type: "core::integer::u16"
2719
+ },
2720
+ {
2721
+ name: "refund_share",
2722
+ type: "core::integer::u16"
2723
+ },
2724
+ {
2725
+ name: "distribution",
2726
+ type: "game_components_interfaces::distribution::Distribution"
2727
+ },
2728
+ {
2729
+ name: "distribution_count",
2730
+ type: "core::integer::u32"
2731
+ }
2732
+ ]
2733
+ },
2734
+ {
2735
+ type: "enum",
2736
+ name: "core::option::Option::<budokan_interfaces::budokan::EntryFee>",
2737
+ variants: [
2738
+ {
2739
+ name: "Some",
2740
+ type: "budokan_interfaces::budokan::EntryFee"
2741
+ },
2742
+ {
2743
+ name: "None",
2744
+ type: "()"
2745
+ }
2746
+ ]
2747
+ },
2748
+ {
2749
+ type: "struct",
2750
+ name: "core::array::Span::<core::starknet::contract_address::ContractAddress>",
2751
+ members: [
2752
+ {
2753
+ name: "snapshot",
2754
+ type: "@core::array::Array::<core::starknet::contract_address::ContractAddress>"
2755
+ }
2756
+ ]
2757
+ },
2758
+ {
2759
+ type: "struct",
2760
+ name: "core::array::Span::<core::felt252>",
2761
+ members: [
2762
+ {
2763
+ name: "snapshot",
2764
+ type: "@core::array::Array::<core::felt252>"
2765
+ }
2766
+ ]
2767
+ },
2768
+ {
2769
+ type: "struct",
2770
+ name: "interfaces::extension::ExtensionConfig",
2771
+ members: [
2772
+ {
2773
+ name: "address",
2774
+ type: "core::starknet::contract_address::ContractAddress"
2775
+ },
2776
+ {
2777
+ name: "config",
2778
+ type: "core::array::Span::<core::felt252>"
2779
+ }
2780
+ ]
2781
+ },
2782
+ {
2783
+ type: "enum",
2784
+ name: "game_components_interfaces::entry_requirement::EntryRequirementType",
2785
+ variants: [
2786
+ {
2787
+ name: "token",
2788
+ type: "core::starknet::contract_address::ContractAddress"
2789
+ },
2790
+ {
2791
+ name: "extension",
2792
+ type: "interfaces::extension::ExtensionConfig"
2793
+ }
2794
+ ]
2795
+ },
2796
+ {
2797
+ type: "struct",
2798
+ name: "game_components_interfaces::entry_requirement::EntryRequirement",
2799
+ members: [
2800
+ {
2801
+ name: "entry_limit",
2802
+ type: "core::integer::u32"
2803
+ },
2804
+ {
2805
+ name: "entry_requirement_type",
2806
+ type: "game_components_interfaces::entry_requirement::EntryRequirementType"
2807
+ }
2808
+ ]
2809
+ },
2810
+ {
2811
+ type: "enum",
2812
+ name: "core::option::Option::<game_components_interfaces::entry_requirement::EntryRequirement>",
2813
+ variants: [
2814
+ {
2815
+ name: "Some",
2816
+ type: "game_components_interfaces::entry_requirement::EntryRequirement"
2817
+ },
2818
+ {
2819
+ name: "None",
2820
+ type: "()"
2821
+ }
2822
+ ]
2823
+ },
2824
+ {
2825
+ type: "struct",
2826
+ name: "budokan_interfaces::budokan::LeaderboardConfig",
2827
+ members: [
2828
+ {
2829
+ name: "ascending",
2830
+ type: "core::bool"
2831
+ },
2832
+ {
2833
+ name: "game_must_be_over",
2834
+ type: "core::bool"
2835
+ }
2836
+ ]
2837
+ },
2838
+ {
2839
+ type: "struct",
2840
+ name: "budokan_interfaces::budokan::Tournament",
2841
+ members: [
2842
+ {
2843
+ name: "id",
2844
+ type: "core::integer::u64"
2845
+ },
2846
+ {
2847
+ name: "created_at",
2848
+ type: "core::integer::u64"
2849
+ },
2850
+ {
2851
+ name: "created_by",
2852
+ type: "core::starknet::contract_address::ContractAddress"
2853
+ },
2854
+ {
2855
+ name: "creator_token_id",
2856
+ type: "core::felt252"
2857
+ },
2858
+ {
2859
+ name: "metadata",
2860
+ type: "budokan_interfaces::budokan::Metadata"
2861
+ },
2862
+ {
2863
+ name: "schedule",
2864
+ type: "budokan_interfaces::budokan::Schedule"
2865
+ },
2866
+ {
2867
+ name: "game_config",
2868
+ type: "budokan_interfaces::budokan::GameConfig"
2869
+ },
2870
+ {
2871
+ name: "entry_fee",
2872
+ type: "core::option::Option::<budokan_interfaces::budokan::EntryFee>"
2873
+ },
2874
+ {
2875
+ name: "entry_requirement",
2876
+ type: "core::option::Option::<game_components_interfaces::entry_requirement::EntryRequirement>"
2877
+ },
2878
+ {
2879
+ name: "leaderboard_config",
2880
+ type: "budokan_interfaces::budokan::LeaderboardConfig"
2881
+ }
2882
+ ]
2883
+ },
2884
+ {
2885
+ type: "enum",
2886
+ name: "budokan_interfaces::budokan::Phase",
2887
+ variants: [
2888
+ {
2889
+ name: "Scheduled",
2890
+ type: "()"
2891
+ },
2892
+ {
2893
+ name: "Registration",
2894
+ type: "()"
2895
+ },
2896
+ {
2897
+ name: "Staging",
2898
+ type: "()"
2899
+ },
2900
+ {
2901
+ name: "Live",
2902
+ type: "()"
2903
+ },
2904
+ {
2905
+ name: "Submission",
2906
+ type: "()"
2907
+ },
2908
+ {
2909
+ name: "Finalized",
2910
+ type: "()"
2911
+ }
2912
+ ]
2913
+ },
2914
+ {
2915
+ type: "struct",
2916
+ name: "core::integer::u256",
2917
+ members: [
2918
+ {
2919
+ name: "low",
2920
+ type: "core::integer::u128"
2921
+ },
2922
+ {
2923
+ name: "high",
2924
+ type: "core::integer::u128"
2925
+ }
2926
+ ]
2927
+ },
2928
+ {
2929
+ type: "struct",
2930
+ name: "game_components_interfaces::entry_requirement::NFTQualification",
2931
+ members: [
2932
+ {
2933
+ name: "token_id",
2934
+ type: "core::integer::u256"
2935
+ }
2936
+ ]
2937
+ },
2938
+ {
2939
+ type: "enum",
2940
+ name: "game_components_interfaces::entry_requirement::QualificationProof",
2941
+ variants: [
2942
+ {
2943
+ name: "NFT",
2944
+ type: "game_components_interfaces::entry_requirement::NFTQualification"
2945
+ },
2946
+ {
2947
+ name: "Address",
2948
+ type: "core::starknet::contract_address::ContractAddress"
2949
+ },
2950
+ {
2951
+ name: "Extension",
2952
+ type: "core::array::Span::<core::felt252>"
2953
+ }
2954
+ ]
2955
+ },
2956
+ {
2957
+ type: "enum",
2958
+ name: "core::option::Option::<game_components_interfaces::entry_requirement::QualificationProof>",
2959
+ variants: [
2960
+ {
2961
+ name: "Some",
2962
+ type: "game_components_interfaces::entry_requirement::QualificationProof"
2963
+ },
2964
+ {
2965
+ name: "None",
2966
+ type: "()"
2967
+ }
2968
+ ]
2969
+ },
2970
+ {
2971
+ type: "enum",
2972
+ name: "game_components_interfaces::prize::PrizeType",
2973
+ variants: [
2974
+ {
2975
+ name: "Single",
2976
+ type: "core::integer::u64"
2977
+ },
2978
+ {
2979
+ name: "Distributed",
2980
+ type: "(core::integer::u64, core::integer::u32)"
2981
+ }
2982
+ ]
2983
+ },
2984
+ {
2985
+ type: "enum",
2986
+ name: "budokan_interfaces::budokan::EntryFeeRewardType",
2987
+ variants: [
2988
+ {
2989
+ name: "Position",
2990
+ type: "core::integer::u32"
2991
+ },
2992
+ {
2993
+ name: "TournamentCreator",
2994
+ type: "()"
2995
+ },
2996
+ {
2997
+ name: "GameCreator",
2998
+ type: "()"
2999
+ },
3000
+ {
3001
+ name: "Refund",
3002
+ type: "core::felt252"
3003
+ }
3004
+ ]
3005
+ },
3006
+ {
3007
+ type: "enum",
3008
+ name: "budokan_interfaces::budokan::RewardType",
3009
+ variants: [
3010
+ {
3011
+ name: "Prize",
3012
+ type: "game_components_interfaces::prize::PrizeType"
3013
+ },
3014
+ {
3015
+ name: "EntryFee",
3016
+ type: "budokan_interfaces::budokan::EntryFeeRewardType"
3017
+ }
3018
+ ]
3019
+ },
3020
+ {
3021
+ type: "enum",
3022
+ name: "core::option::Option::<game_components_interfaces::distribution::Distribution>",
3023
+ variants: [
3024
+ {
3025
+ name: "Some",
3026
+ type: "game_components_interfaces::distribution::Distribution"
3027
+ },
3028
+ {
3029
+ name: "None",
3030
+ type: "()"
3031
+ }
3032
+ ]
3033
+ },
3034
+ {
3035
+ type: "struct",
3036
+ name: "game_components_interfaces::prize::ERC20Data",
3037
+ members: [
3038
+ {
3039
+ name: "amount",
3040
+ type: "core::integer::u128"
3041
+ },
3042
+ {
3043
+ name: "distribution",
3044
+ type: "core::option::Option::<game_components_interfaces::distribution::Distribution>"
3045
+ },
3046
+ {
3047
+ name: "distribution_count",
3048
+ type: "core::option::Option::<core::integer::u32>"
3049
+ }
3050
+ ]
3051
+ },
3052
+ {
3053
+ type: "struct",
3054
+ name: "game_components_interfaces::prize::ERC721Data",
3055
+ members: [
3056
+ {
3057
+ name: "id",
3058
+ type: "core::integer::u128"
3059
+ }
3060
+ ]
3061
+ },
3062
+ {
3063
+ type: "enum",
3064
+ name: "game_components_interfaces::prize::TokenTypeData",
3065
+ variants: [
3066
+ {
3067
+ name: "erc20",
3068
+ type: "game_components_interfaces::prize::ERC20Data"
3069
+ },
3070
+ {
3071
+ name: "erc721",
3072
+ type: "game_components_interfaces::prize::ERC721Data"
3073
+ }
3074
+ ]
3075
+ },
3076
+ {
3077
+ type: "struct",
3078
+ name: "game_components_interfaces::prize::PrizeData",
3079
+ members: [
3080
+ {
3081
+ name: "id",
3082
+ type: "core::integer::u64"
3083
+ },
3084
+ {
3085
+ name: "context_id",
3086
+ type: "core::integer::u64"
3087
+ },
3088
+ {
3089
+ name: "token_address",
3090
+ type: "core::starknet::contract_address::ContractAddress"
3091
+ },
3092
+ {
3093
+ name: "token_type",
3094
+ type: "game_components_interfaces::prize::TokenTypeData"
3095
+ },
3096
+ {
3097
+ name: "sponsor_address",
3098
+ type: "core::starknet::contract_address::ContractAddress"
3099
+ }
3100
+ ]
3101
+ },
3102
+ {
3103
+ type: "interface",
3104
+ name: "budokan_interfaces::budokan::IBudokan",
3105
+ items: [
3106
+ {
3107
+ type: "function",
3108
+ name: "total_tournaments",
3109
+ inputs: [],
3110
+ outputs: [
3111
+ {
3112
+ type: "core::integer::u64"
3113
+ }
3114
+ ],
3115
+ state_mutability: "view"
3116
+ },
3117
+ {
3118
+ type: "function",
3119
+ name: "tournament",
3120
+ inputs: [
3121
+ {
3122
+ name: "tournament_id",
3123
+ type: "core::integer::u64"
3124
+ }
3125
+ ],
3126
+ outputs: [
3127
+ {
3128
+ type: "budokan_interfaces::budokan::Tournament"
3129
+ }
3130
+ ],
3131
+ state_mutability: "view"
3132
+ },
3133
+ {
3134
+ type: "function",
3135
+ name: "tournament_entries",
3136
+ inputs: [
3137
+ {
3138
+ name: "tournament_id",
3139
+ type: "core::integer::u64"
3140
+ }
3141
+ ],
3142
+ outputs: [
3143
+ {
3144
+ type: "core::integer::u32"
3145
+ }
3146
+ ],
3147
+ state_mutability: "view"
3148
+ },
3149
+ {
3150
+ type: "function",
3151
+ name: "get_leaderboard",
3152
+ inputs: [
3153
+ {
3154
+ name: "tournament_id",
3155
+ type: "core::integer::u64"
3156
+ }
3157
+ ],
3158
+ outputs: [
3159
+ {
3160
+ type: "core::array::Array::<core::felt252>"
3161
+ }
3162
+ ],
3163
+ state_mutability: "view"
3164
+ },
3165
+ {
3166
+ type: "function",
3167
+ name: "current_phase",
3168
+ inputs: [
3169
+ {
3170
+ name: "tournament_id",
3171
+ type: "core::integer::u64"
3172
+ }
3173
+ ],
3174
+ outputs: [
3175
+ {
3176
+ type: "budokan_interfaces::budokan::Phase"
3177
+ }
3178
+ ],
3179
+ state_mutability: "view"
3180
+ },
3181
+ {
3182
+ type: "function",
3183
+ name: "tournament_distribution_shares",
3184
+ inputs: [
3185
+ {
3186
+ name: "tournament_id",
3187
+ type: "core::integer::u64"
3188
+ }
3189
+ ],
3190
+ outputs: [
3191
+ {
3192
+ type: "core::array::Array::<core::integer::u16>"
3193
+ }
3194
+ ],
3195
+ state_mutability: "view"
3196
+ },
3197
+ {
3198
+ type: "function",
3199
+ name: "create_tournament",
3200
+ inputs: [
3201
+ {
3202
+ name: "creator_rewards_address",
3203
+ type: "core::starknet::contract_address::ContractAddress"
3204
+ },
3205
+ {
3206
+ name: "metadata",
3207
+ type: "budokan_interfaces::budokan::Metadata"
3208
+ },
3209
+ {
3210
+ name: "schedule",
3211
+ type: "budokan_interfaces::budokan::Schedule"
3212
+ },
3213
+ {
3214
+ name: "game_config",
3215
+ type: "budokan_interfaces::budokan::GameConfig"
3216
+ },
3217
+ {
3218
+ name: "entry_fee",
3219
+ type: "core::option::Option::<budokan_interfaces::budokan::EntryFee>"
3220
+ },
3221
+ {
3222
+ name: "entry_requirement",
3223
+ type: "core::option::Option::<game_components_interfaces::entry_requirement::EntryRequirement>"
3224
+ },
3225
+ {
3226
+ name: "leaderboard_config",
3227
+ type: "budokan_interfaces::budokan::LeaderboardConfig"
3228
+ },
3229
+ {
3230
+ name: "salt",
3231
+ type: "core::integer::u16"
3232
+ },
3233
+ {
3234
+ name: "metadata_value",
3235
+ type: "core::integer::u16"
3236
+ }
3237
+ ],
3238
+ outputs: [
3239
+ {
3240
+ type: "budokan_interfaces::budokan::Tournament"
3241
+ }
3242
+ ],
3243
+ state_mutability: "external"
3244
+ },
3245
+ {
3246
+ type: "function",
3247
+ name: "enter_tournament",
3248
+ inputs: [
3249
+ {
3250
+ name: "tournament_id",
3251
+ type: "core::integer::u64"
3252
+ },
3253
+ {
3254
+ name: "player_name",
3255
+ type: "core::felt252"
3256
+ },
3257
+ {
3258
+ name: "player_address",
3259
+ type: "core::starknet::contract_address::ContractAddress"
3260
+ },
3261
+ {
3262
+ name: "qualification",
3263
+ type: "core::option::Option::<game_components_interfaces::entry_requirement::QualificationProof>"
3264
+ },
3265
+ {
3266
+ name: "salt",
3267
+ type: "core::integer::u16"
3268
+ },
3269
+ {
3270
+ name: "metadata_value",
3271
+ type: "core::integer::u16"
3272
+ }
3273
+ ],
3274
+ outputs: [
3275
+ {
3276
+ type: "(core::felt252, core::integer::u32)"
3277
+ }
3278
+ ],
3279
+ state_mutability: "external"
3280
+ },
3281
+ {
3282
+ type: "function",
3283
+ name: "ban_entry",
3284
+ inputs: [
3285
+ {
3286
+ name: "tournament_id",
3287
+ type: "core::integer::u64"
3288
+ },
3289
+ {
3290
+ name: "game_token_id",
3291
+ type: "core::felt252"
3292
+ },
3293
+ {
3294
+ name: "proof",
3295
+ type: "core::array::Span::<core::felt252>"
3296
+ }
3297
+ ],
3298
+ outputs: [],
3299
+ state_mutability: "external"
3300
+ },
3301
+ {
3302
+ type: "function",
3303
+ name: "submit_score",
3304
+ inputs: [
3305
+ {
3306
+ name: "tournament_id",
3307
+ type: "core::integer::u64"
3308
+ },
3309
+ {
3310
+ name: "token_id",
3311
+ type: "core::felt252"
3312
+ },
3313
+ {
3314
+ name: "position",
3315
+ type: "core::integer::u32"
3316
+ }
3317
+ ],
3318
+ outputs: [],
3319
+ state_mutability: "external"
3320
+ },
3321
+ {
3322
+ type: "function",
3323
+ name: "claim_reward",
3324
+ inputs: [
3325
+ {
3326
+ name: "tournament_id",
3327
+ type: "core::integer::u64"
3328
+ },
3329
+ {
3330
+ name: "reward_type",
3331
+ type: "budokan_interfaces::budokan::RewardType"
3332
+ }
3333
+ ],
3334
+ outputs: [],
3335
+ state_mutability: "external"
3336
+ },
3337
+ {
3338
+ type: "function",
3339
+ name: "add_prize",
3340
+ inputs: [
3341
+ {
3342
+ name: "tournament_id",
3343
+ type: "core::integer::u64"
3344
+ },
3345
+ {
3346
+ name: "token_address",
3347
+ type: "core::starknet::contract_address::ContractAddress"
3348
+ },
3349
+ {
3350
+ name: "token_type",
3351
+ type: "game_components_interfaces::prize::TokenTypeData"
3352
+ },
3353
+ {
3354
+ name: "position",
3355
+ type: "core::option::Option::<core::integer::u32>"
3356
+ }
3357
+ ],
3358
+ outputs: [
3359
+ {
3360
+ type: "game_components_interfaces::prize::PrizeData"
3361
+ }
3362
+ ],
3363
+ state_mutability: "external"
3364
+ }
3365
+ ]
3366
+ },
3367
+ {
3368
+ type: "impl",
3369
+ name: "MetagameImpl",
3370
+ interface_name: "game_components_interfaces::metagame::core::IMetagame"
3371
+ },
3372
+ {
3373
+ type: "interface",
3374
+ name: "game_components_interfaces::metagame::core::IMetagame",
3375
+ items: [
3376
+ {
3377
+ type: "function",
3378
+ name: "context_address",
3379
+ inputs: [],
3380
+ outputs: [
3381
+ {
3382
+ type: "core::starknet::contract_address::ContractAddress"
3383
+ }
3384
+ ],
3385
+ state_mutability: "view"
3386
+ },
3387
+ {
3388
+ type: "function",
3389
+ name: "default_token_address",
3390
+ inputs: [],
3391
+ outputs: [
3392
+ {
3393
+ type: "core::starknet::contract_address::ContractAddress"
3394
+ }
3395
+ ],
3396
+ state_mutability: "view"
3397
+ }
3398
+ ]
3399
+ },
3400
+ {
3401
+ type: "impl",
3402
+ name: "SRC5Impl",
3403
+ interface_name: "openzeppelin_interfaces::introspection::ISRC5"
3404
+ },
3405
+ {
3406
+ type: "interface",
3407
+ name: "openzeppelin_interfaces::introspection::ISRC5",
3408
+ items: [
3409
+ {
3410
+ type: "function",
3411
+ name: "supports_interface",
3412
+ inputs: [
3413
+ {
3414
+ name: "interface_id",
3415
+ type: "core::felt252"
3416
+ }
3417
+ ],
3418
+ outputs: [
3419
+ {
3420
+ type: "core::bool"
3421
+ }
3422
+ ],
3423
+ state_mutability: "view"
3424
+ }
3425
+ ]
3426
+ },
3427
+ {
3428
+ type: "impl",
3429
+ name: "OwnableImpl",
3430
+ interface_name: "openzeppelin_interfaces::access::ownable::IOwnable"
3431
+ },
3432
+ {
3433
+ type: "interface",
3434
+ name: "openzeppelin_interfaces::access::ownable::IOwnable",
3435
+ items: [
3436
+ {
3437
+ type: "function",
3438
+ name: "owner",
3439
+ inputs: [],
3440
+ outputs: [
3441
+ {
3442
+ type: "core::starknet::contract_address::ContractAddress"
3443
+ }
3444
+ ],
3445
+ state_mutability: "view"
3446
+ },
3447
+ {
3448
+ type: "function",
3449
+ name: "transfer_ownership",
3450
+ inputs: [
3451
+ {
3452
+ name: "new_owner",
3453
+ type: "core::starknet::contract_address::ContractAddress"
3454
+ }
3455
+ ],
3456
+ outputs: [],
3457
+ state_mutability: "external"
3458
+ },
3459
+ {
3460
+ type: "function",
3461
+ name: "renounce_ownership",
3462
+ inputs: [],
3463
+ outputs: [],
3464
+ state_mutability: "external"
3465
+ }
3466
+ ]
3467
+ },
3468
+ {
3469
+ type: "impl",
3470
+ name: "EntryFeeImpl",
3471
+ interface_name: "game_components_interfaces::entry_fee::IEntryFee"
3472
+ },
3473
+ {
3474
+ type: "enum",
3475
+ name: "core::option::Option::<core::integer::u16>",
3476
+ variants: [
3477
+ {
3478
+ name: "Some",
3479
+ type: "core::integer::u16"
3480
+ },
3481
+ {
3482
+ name: "None",
3483
+ type: "()"
3484
+ }
3485
+ ]
3486
+ },
3487
+ {
3488
+ type: "struct",
3489
+ name: "game_components_interfaces::entry_fee::AdditionalShare",
3490
+ members: [
3491
+ {
3492
+ name: "recipient",
3493
+ type: "core::starknet::contract_address::ContractAddress"
3494
+ },
3495
+ {
3496
+ name: "share_bps",
3497
+ type: "core::integer::u16"
3498
+ }
3499
+ ]
3500
+ },
3501
+ {
3502
+ type: "struct",
3503
+ name: "core::array::Span::<game_components_interfaces::entry_fee::AdditionalShare>",
3504
+ members: [
3505
+ {
3506
+ name: "snapshot",
3507
+ type: "@core::array::Array::<game_components_interfaces::entry_fee::AdditionalShare>"
3508
+ }
3509
+ ]
3510
+ },
3511
+ {
3512
+ type: "struct",
3513
+ name: "game_components_interfaces::entry_fee::EntryFeeConfig",
3514
+ members: [
3515
+ {
3516
+ name: "token_address",
3517
+ type: "core::starknet::contract_address::ContractAddress"
3518
+ },
3519
+ {
3520
+ name: "amount",
3521
+ type: "core::integer::u128"
3522
+ },
3523
+ {
3524
+ name: "game_creator_share",
3525
+ type: "core::option::Option::<core::integer::u16>"
3526
+ },
3527
+ {
3528
+ name: "refund_share",
3529
+ type: "core::option::Option::<core::integer::u16>"
3530
+ },
3531
+ {
3532
+ name: "additional_shares",
3533
+ type: "core::array::Span::<game_components_interfaces::entry_fee::AdditionalShare>"
3534
+ }
3535
+ ]
3536
+ },
3537
+ {
3538
+ type: "enum",
3539
+ name: "core::option::Option::<game_components_interfaces::entry_fee::EntryFeeConfig>",
3540
+ variants: [
3541
+ {
3542
+ name: "Some",
3543
+ type: "game_components_interfaces::entry_fee::EntryFeeConfig"
3544
+ },
3545
+ {
3546
+ name: "None",
3547
+ type: "()"
3548
+ }
3549
+ ]
3550
+ },
3551
+ {
3552
+ type: "interface",
3553
+ name: "game_components_interfaces::entry_fee::IEntryFee",
3554
+ items: [
3555
+ {
3556
+ type: "function",
3557
+ name: "get_entry_fee",
3558
+ inputs: [
3559
+ {
3560
+ name: "context_id",
3561
+ type: "core::integer::u64"
3562
+ }
3563
+ ],
3564
+ outputs: [
3565
+ {
3566
+ type: "core::option::Option::<game_components_interfaces::entry_fee::EntryFeeConfig>"
3567
+ }
3568
+ ],
3569
+ state_mutability: "view"
3570
+ }
3571
+ ]
3572
+ },
3573
+ {
3574
+ type: "impl",
3575
+ name: "EntryRequirementImpl",
3576
+ interface_name: "game_components_interfaces::entry_requirement::IEntryRequirement"
3577
+ },
3578
+ {
3579
+ type: "struct",
3580
+ name: "game_components_interfaces::entry_requirement::QualificationEntries",
3581
+ members: [
3582
+ {
3583
+ name: "context_id",
3584
+ type: "core::integer::u64"
3585
+ },
3586
+ {
3587
+ name: "qualification_proof",
3588
+ type: "game_components_interfaces::entry_requirement::QualificationProof"
3589
+ },
3590
+ {
3591
+ name: "entry_count",
3592
+ type: "core::integer::u32"
3593
+ }
3594
+ ]
3595
+ },
3596
+ {
3597
+ type: "interface",
3598
+ name: "game_components_interfaces::entry_requirement::IEntryRequirement",
3599
+ items: [
3600
+ {
3601
+ type: "function",
3602
+ name: "get_entry_requirement",
3603
+ inputs: [
3604
+ {
3605
+ name: "context_id",
3606
+ type: "core::integer::u64"
3607
+ }
3608
+ ],
3609
+ outputs: [
3610
+ {
3611
+ type: "core::option::Option::<game_components_interfaces::entry_requirement::EntryRequirement>"
3612
+ }
3613
+ ],
3614
+ state_mutability: "view"
3615
+ },
3616
+ {
3617
+ type: "function",
3618
+ name: "get_qualification_entries",
3619
+ inputs: [
3620
+ {
3621
+ name: "context_id",
3622
+ type: "core::integer::u64"
3623
+ },
3624
+ {
3625
+ name: "proof",
3626
+ type: "game_components_interfaces::entry_requirement::QualificationProof"
3627
+ }
3628
+ ],
3629
+ outputs: [
3630
+ {
3631
+ type: "game_components_interfaces::entry_requirement::QualificationEntries"
3632
+ }
3633
+ ],
3634
+ state_mutability: "view"
3635
+ }
3636
+ ]
3637
+ },
3638
+ {
3639
+ type: "impl",
3640
+ name: "PrizeImpl",
3641
+ interface_name: "game_components_interfaces::prize::IPrize"
3642
+ },
3643
+ {
3644
+ type: "interface",
3645
+ name: "game_components_interfaces::prize::IPrize",
3646
+ items: [
3647
+ {
3648
+ type: "function",
3649
+ name: "get_prize",
3650
+ inputs: [
3651
+ {
3652
+ name: "prize_id",
3653
+ type: "core::integer::u64"
3654
+ }
3655
+ ],
3656
+ outputs: [
3657
+ {
3658
+ type: "game_components_interfaces::prize::PrizeData"
3659
+ }
3660
+ ],
3661
+ state_mutability: "view"
3662
+ },
3663
+ {
3664
+ type: "function",
3665
+ name: "get_total_prizes",
3666
+ inputs: [],
3667
+ outputs: [
3668
+ {
3669
+ type: "core::integer::u64"
3670
+ }
3671
+ ],
3672
+ state_mutability: "view"
3673
+ },
3674
+ {
3675
+ type: "function",
3676
+ name: "is_prize_claimed",
3677
+ inputs: [
3678
+ {
3679
+ name: "context_id",
3680
+ type: "core::integer::u64"
3681
+ },
3682
+ {
3683
+ name: "prize_type",
3684
+ type: "game_components_interfaces::prize::PrizeType"
3685
+ }
3686
+ ],
3687
+ outputs: [
3688
+ {
3689
+ type: "core::bool"
3690
+ }
3691
+ ],
3692
+ state_mutability: "view"
3693
+ }
3694
+ ]
3695
+ },
3696
+ {
3697
+ type: "impl",
3698
+ name: "RegistrationImpl",
3699
+ interface_name: "game_components_interfaces::registration::IRegistration"
3700
+ },
3701
+ {
3702
+ type: "struct",
3703
+ name: "game_components_interfaces::registration::Registration",
3704
+ members: [
3705
+ {
3706
+ name: "context_id",
3707
+ type: "core::integer::u64"
3708
+ },
3709
+ {
3710
+ name: "entry_id",
3711
+ type: "core::integer::u32"
3712
+ },
3713
+ {
3714
+ name: "game_token_id",
3715
+ type: "core::felt252"
3716
+ },
3717
+ {
3718
+ name: "has_submitted",
3719
+ type: "core::bool"
3720
+ },
3721
+ {
3722
+ name: "is_banned",
3723
+ type: "core::bool"
3724
+ }
3725
+ ]
3726
+ },
3727
+ {
3728
+ type: "interface",
3729
+ name: "game_components_interfaces::registration::IRegistration",
3730
+ items: [
3731
+ {
3732
+ type: "function",
3733
+ name: "get_entry",
3734
+ inputs: [
3735
+ {
3736
+ name: "context_id",
3737
+ type: "core::integer::u64"
3738
+ },
3739
+ {
3740
+ name: "entry_id",
3741
+ type: "core::integer::u32"
3742
+ }
3743
+ ],
3744
+ outputs: [
3745
+ {
3746
+ type: "game_components_interfaces::registration::Registration"
3747
+ }
3748
+ ],
3749
+ state_mutability: "view"
3750
+ },
3751
+ {
3752
+ type: "function",
3753
+ name: "entry_exists",
3754
+ inputs: [
3755
+ {
3756
+ name: "context_id",
3757
+ type: "core::integer::u64"
3758
+ },
3759
+ {
3760
+ name: "entry_id",
3761
+ type: "core::integer::u32"
3762
+ }
3763
+ ],
3764
+ outputs: [
3765
+ {
3766
+ type: "core::bool"
3767
+ }
3768
+ ],
3769
+ state_mutability: "view"
3770
+ },
3771
+ {
3772
+ type: "function",
3773
+ name: "is_entry_banned",
3774
+ inputs: [
3775
+ {
3776
+ name: "context_id",
3777
+ type: "core::integer::u64"
3778
+ },
3779
+ {
3780
+ name: "entry_id",
3781
+ type: "core::integer::u32"
3782
+ }
3783
+ ],
3784
+ outputs: [
3785
+ {
3786
+ type: "core::bool"
3787
+ }
3788
+ ],
3789
+ state_mutability: "view"
3790
+ },
3791
+ {
3792
+ type: "function",
3793
+ name: "get_entry_count",
3794
+ inputs: [
3795
+ {
3796
+ name: "context_id",
3797
+ type: "core::integer::u64"
3798
+ }
3799
+ ],
3800
+ outputs: [
3801
+ {
3802
+ type: "core::integer::u32"
3803
+ }
3804
+ ],
3805
+ state_mutability: "view"
3806
+ }
3807
+ ]
3808
+ },
3809
+ {
3810
+ type: "constructor",
3811
+ name: "constructor",
3812
+ inputs: [
3813
+ {
3814
+ name: "owner",
3815
+ type: "core::starknet::contract_address::ContractAddress"
3816
+ },
3817
+ {
3818
+ name: "default_token_address",
3819
+ type: "core::starknet::contract_address::ContractAddress"
3820
+ }
3821
+ ]
3822
+ },
3823
+ {
3824
+ type: "event",
3825
+ name: "game_components_embeddable_game_standard::metagame::metagame_component::MetagameComponent::Event",
3826
+ kind: "enum",
3827
+ variants: []
3828
+ },
3829
+ {
3830
+ type: "event",
3831
+ name: "game_components_embeddable_game_standard::metagame::extensions::context::context::ContextComponent::Event",
3832
+ kind: "enum",
3833
+ variants: []
3834
+ },
3835
+ {
3836
+ type: "event",
3837
+ name: "openzeppelin_introspection::src5::SRC5Component::Event",
3838
+ kind: "enum",
3839
+ variants: []
3840
+ },
3841
+ {
3842
+ type: "event",
3843
+ name: "game_components_metagame::leaderboard::leaderboard_component::LeaderboardComponent::Event",
3844
+ kind: "enum",
3845
+ variants: []
3846
+ },
3847
+ {
3848
+ type: "event",
3849
+ name: "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
3850
+ kind: "struct",
3851
+ members: [
3852
+ {
3853
+ name: "previous_owner",
3854
+ type: "core::starknet::contract_address::ContractAddress",
3855
+ kind: "key"
3856
+ },
3857
+ {
3858
+ name: "new_owner",
3859
+ type: "core::starknet::contract_address::ContractAddress",
3860
+ kind: "key"
3861
+ }
3862
+ ]
3863
+ },
3864
+ {
3865
+ type: "event",
3866
+ name: "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
3867
+ kind: "struct",
3868
+ members: [
3869
+ {
3870
+ name: "previous_owner",
3871
+ type: "core::starknet::contract_address::ContractAddress",
3872
+ kind: "key"
3873
+ },
3874
+ {
3875
+ name: "new_owner",
3876
+ type: "core::starknet::contract_address::ContractAddress",
3877
+ kind: "key"
3878
+ }
3879
+ ]
3880
+ },
3881
+ {
3882
+ type: "event",
3883
+ name: "openzeppelin_access::ownable::ownable::OwnableComponent::Event",
3884
+ kind: "enum",
3885
+ variants: [
3886
+ {
3887
+ name: "OwnershipTransferred",
3888
+ type: "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
3889
+ kind: "nested"
3890
+ },
3891
+ {
3892
+ name: "OwnershipTransferStarted",
3893
+ type: "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
3894
+ kind: "nested"
3895
+ }
3896
+ ]
3897
+ },
3898
+ {
3899
+ type: "event",
3900
+ name: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
3901
+ kind: "struct",
3902
+ members: [
3903
+ {
3904
+ name: "class_hash",
3905
+ type: "core::starknet::class_hash::ClassHash",
3906
+ kind: "data"
3907
+ }
3908
+ ]
3909
+ },
3910
+ {
3911
+ type: "event",
3912
+ name: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
3913
+ kind: "enum",
3914
+ variants: [
3915
+ {
3916
+ name: "Upgraded",
3917
+ type: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
3918
+ kind: "nested"
3919
+ }
3920
+ ]
3921
+ },
3922
+ {
3923
+ type: "event",
3924
+ name: "game_components_metagame::registration::registration_component::RegistrationComponent::Event",
3925
+ kind: "enum",
3926
+ variants: []
3927
+ },
3928
+ {
3929
+ type: "event",
3930
+ name: "game_components_metagame::entry_fee::entry_fee_component::EntryFeeComponent::Event",
3931
+ kind: "enum",
3932
+ variants: []
3933
+ },
3934
+ {
3935
+ type: "event",
3936
+ name: "game_components_metagame::entry_requirement::entry_requirement_component::EntryRequirementComponent::Event",
3937
+ kind: "enum",
3938
+ variants: []
3939
+ },
3940
+ {
3941
+ type: "event",
3942
+ name: "game_components_metagame::prize::prize_component::PrizeComponent::Event",
3943
+ kind: "enum",
3944
+ variants: []
3945
+ },
3946
+ {
3947
+ type: "event",
3948
+ name: "budokan::events::TournamentCreated",
3949
+ kind: "struct",
3950
+ members: [
3951
+ {
3952
+ name: "tournament_id",
3953
+ type: "core::integer::u64",
3954
+ kind: "key"
3955
+ },
3956
+ {
3957
+ name: "game_address",
3958
+ type: "core::starknet::contract_address::ContractAddress",
3959
+ kind: "key"
3960
+ },
3961
+ {
3962
+ name: "created_at",
3963
+ type: "core::integer::u64",
3964
+ kind: "data"
3965
+ },
3966
+ {
3967
+ name: "created_by",
3968
+ type: "core::starknet::contract_address::ContractAddress",
3969
+ kind: "data"
3970
+ },
3971
+ {
3972
+ name: "creator_token_id",
3973
+ type: "core::felt252",
3974
+ kind: "data"
3975
+ },
3976
+ {
3977
+ name: "metadata",
3978
+ type: "budokan_interfaces::budokan::Metadata",
3979
+ kind: "data"
3980
+ },
3981
+ {
3982
+ name: "schedule",
3983
+ type: "budokan_interfaces::budokan::Schedule",
3984
+ kind: "data"
3985
+ },
3986
+ {
3987
+ name: "game_config",
3988
+ type: "budokan_interfaces::budokan::GameConfig",
3989
+ kind: "data"
3990
+ },
3991
+ {
3992
+ name: "entry_fee",
3993
+ type: "core::option::Option::<budokan_interfaces::budokan::EntryFee>",
3994
+ kind: "data"
3995
+ },
3996
+ {
3997
+ name: "entry_requirement",
3998
+ type: "core::option::Option::<game_components_interfaces::entry_requirement::EntryRequirement>",
3999
+ kind: "data"
4000
+ },
4001
+ {
4002
+ name: "leaderboard_config",
4003
+ type: "budokan_interfaces::budokan::LeaderboardConfig",
4004
+ kind: "data"
4005
+ }
4006
+ ]
4007
+ },
4008
+ {
4009
+ type: "event",
4010
+ name: "budokan::events::TournamentRegistration",
4011
+ kind: "struct",
4012
+ members: [
4013
+ {
4014
+ name: "tournament_id",
4015
+ type: "core::integer::u64",
4016
+ kind: "key"
4017
+ },
4018
+ {
4019
+ name: "game_token_id",
4020
+ type: "core::felt252",
4021
+ kind: "key"
4022
+ },
4023
+ {
4024
+ name: "game_address",
4025
+ type: "core::starknet::contract_address::ContractAddress",
4026
+ kind: "data"
4027
+ },
4028
+ {
4029
+ name: "player_address",
4030
+ type: "core::starknet::contract_address::ContractAddress",
4031
+ kind: "data"
4032
+ },
4033
+ {
4034
+ name: "entry_number",
4035
+ type: "core::integer::u32",
4036
+ kind: "data"
4037
+ },
4038
+ {
4039
+ name: "has_submitted",
4040
+ type: "core::bool",
4041
+ kind: "data"
4042
+ },
4043
+ {
4044
+ name: "is_banned",
4045
+ type: "core::bool",
4046
+ kind: "data"
4047
+ }
4048
+ ]
4049
+ },
4050
+ {
4051
+ type: "event",
4052
+ name: "budokan::events::LeaderboardUpdated",
4053
+ kind: "struct",
4054
+ members: [
4055
+ {
4056
+ name: "tournament_id",
4057
+ type: "core::integer::u64",
4058
+ kind: "key"
4059
+ },
4060
+ {
4061
+ name: "token_ids",
4062
+ type: "core::array::Span::<core::felt252>",
4063
+ kind: "data"
4064
+ }
4065
+ ]
4066
+ },
4067
+ {
4068
+ type: "event",
4069
+ name: "budokan::events::PrizeAdded",
4070
+ kind: "struct",
4071
+ members: [
4072
+ {
4073
+ name: "tournament_id",
4074
+ type: "core::integer::u64",
4075
+ kind: "key"
4076
+ },
4077
+ {
4078
+ name: "prize_id",
4079
+ type: "core::integer::u64",
4080
+ kind: "key"
4081
+ },
4082
+ {
4083
+ name: "payout_position",
4084
+ type: "core::integer::u32",
4085
+ kind: "data"
4086
+ },
4087
+ {
4088
+ name: "token_address",
4089
+ type: "core::starknet::contract_address::ContractAddress",
4090
+ kind: "data"
4091
+ },
4092
+ {
4093
+ name: "token_type",
4094
+ type: "game_components_interfaces::prize::TokenTypeData",
4095
+ kind: "data"
4096
+ },
4097
+ {
4098
+ name: "sponsor_address",
4099
+ type: "core::starknet::contract_address::ContractAddress",
4100
+ kind: "data"
4101
+ }
4102
+ ]
4103
+ },
4104
+ {
4105
+ type: "event",
4106
+ name: "budokan::events::RewardClaimed",
4107
+ kind: "struct",
4108
+ members: [
4109
+ {
4110
+ name: "tournament_id",
4111
+ type: "core::integer::u64",
4112
+ kind: "key"
4113
+ },
4114
+ {
4115
+ name: "reward_type",
4116
+ type: "budokan_interfaces::budokan::RewardType",
4117
+ kind: "data"
4118
+ },
4119
+ {
4120
+ name: "claimed",
4121
+ type: "core::bool",
4122
+ kind: "data"
4123
+ }
4124
+ ]
4125
+ },
4126
+ {
4127
+ type: "event",
4128
+ name: "budokan::events::QualificationEntriesUpdated",
4129
+ kind: "struct",
4130
+ members: [
4131
+ {
4132
+ name: "tournament_id",
4133
+ type: "core::integer::u64",
4134
+ kind: "key"
4135
+ },
4136
+ {
4137
+ name: "qualification_proof",
4138
+ type: "game_components_interfaces::entry_requirement::QualificationProof",
4139
+ kind: "data"
4140
+ },
4141
+ {
4142
+ name: "entry_count",
4143
+ type: "core::integer::u32",
4144
+ kind: "data"
4145
+ }
4146
+ ]
4147
+ },
4148
+ {
4149
+ type: "event",
4150
+ name: "budokan::budokan::Budokan::Event",
4151
+ kind: "enum",
4152
+ variants: [
4153
+ {
4154
+ name: "MetagameEvent",
4155
+ type: "game_components_embeddable_game_standard::metagame::metagame_component::MetagameComponent::Event",
4156
+ kind: "flat"
4157
+ },
4158
+ {
4159
+ name: "ContextEvent",
4160
+ type: "game_components_embeddable_game_standard::metagame::extensions::context::context::ContextComponent::Event",
4161
+ kind: "flat"
4162
+ },
4163
+ {
4164
+ name: "SRC5Event",
4165
+ type: "openzeppelin_introspection::src5::SRC5Component::Event",
4166
+ kind: "flat"
4167
+ },
4168
+ {
4169
+ name: "LeaderboardEvent",
4170
+ type: "game_components_metagame::leaderboard::leaderboard_component::LeaderboardComponent::Event",
4171
+ kind: "flat"
4172
+ },
4173
+ {
4174
+ name: "OwnableEvent",
4175
+ type: "openzeppelin_access::ownable::ownable::OwnableComponent::Event",
4176
+ kind: "flat"
4177
+ },
4178
+ {
4179
+ name: "UpgradeableEvent",
4180
+ type: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
4181
+ kind: "flat"
4182
+ },
4183
+ {
4184
+ name: "RegistrationEvent",
4185
+ type: "game_components_metagame::registration::registration_component::RegistrationComponent::Event",
4186
+ kind: "flat"
4187
+ },
4188
+ {
4189
+ name: "EntryFeeEvent",
4190
+ type: "game_components_metagame::entry_fee::entry_fee_component::EntryFeeComponent::Event",
4191
+ kind: "flat"
4192
+ },
4193
+ {
4194
+ name: "EntryRequirementEvent",
4195
+ type: "game_components_metagame::entry_requirement::entry_requirement_component::EntryRequirementComponent::Event",
4196
+ kind: "flat"
4197
+ },
4198
+ {
4199
+ name: "PrizeEvent",
4200
+ type: "game_components_metagame::prize::prize_component::PrizeComponent::Event",
4201
+ kind: "flat"
4202
+ },
4203
+ {
4204
+ name: "TournamentCreated",
4205
+ type: "budokan::events::TournamentCreated",
4206
+ kind: "nested"
4207
+ },
4208
+ {
4209
+ name: "TournamentRegistration",
4210
+ type: "budokan::events::TournamentRegistration",
4211
+ kind: "nested"
4212
+ },
4213
+ {
4214
+ name: "LeaderboardUpdated",
4215
+ type: "budokan::events::LeaderboardUpdated",
4216
+ kind: "nested"
4217
+ },
4218
+ {
4219
+ name: "PrizeAdded",
4220
+ type: "budokan::events::PrizeAdded",
4221
+ kind: "nested"
4222
+ },
4223
+ {
4224
+ name: "RewardClaimed",
4225
+ type: "budokan::events::RewardClaimed",
4226
+ kind: "nested"
4227
+ },
4228
+ {
4229
+ name: "QualificationEntriesUpdated",
4230
+ type: "budokan::events::QualificationEntriesUpdated",
4231
+ kind: "nested"
4232
+ }
4233
+ ]
4234
+ }
4235
+ ];
4236
+
4237
+ // src/rpc/budokan.ts
4238
+ function wrapRpcCall2(fn, contractAddress) {
4239
+ return fn().catch((error) => {
4240
+ throw new RpcError(
4241
+ error instanceof Error ? error.message : "RPC call failed",
4242
+ contractAddress
4243
+ );
4244
+ });
4245
+ }
4246
+ async function budokanTournamentDistributionShares(contract, tournamentId) {
4247
+ return wrapRpcCall2(async () => {
4248
+ const result = await contract.call("tournament_distribution_shares", [tournamentId]);
4249
+ const arr = Array.isArray(result) ? result : [];
4250
+ return arr.map((v) => Number(v));
4251
+ }, contract.address);
4252
+ }
4253
+
2394
4254
  // src/client.ts
2395
4255
  var BudokanClient = class {
2396
4256
  resolvedConfig;
@@ -2398,6 +4258,7 @@ var BudokanClient = class {
2398
4258
  connectionStatus;
2399
4259
  cachedProvider = null;
2400
4260
  cachedViewerContract = null;
4261
+ cachedBudokanContract = null;
2401
4262
  constructor(config) {
2402
4263
  const chainConfig = config.chain ? getChainConfig(config.chain) : void 0;
2403
4264
  this.resolvedConfig = {
@@ -2465,6 +4326,19 @@ var BudokanClient = class {
2465
4326
  );
2466
4327
  return this.cachedViewerContract;
2467
4328
  }
4329
+ async getBudokanContract() {
4330
+ if (this.cachedBudokanContract) return this.cachedBudokanContract;
4331
+ if (!this.resolvedConfig.budokanAddress) {
4332
+ throw new RpcError("No budokanAddress configured. Set budokanAddress in config or use a chain preset with a deployed Budokan contract.");
4333
+ }
4334
+ const provider = await this.getProvider();
4335
+ this.cachedBudokanContract = await createContract(
4336
+ budokan_default,
4337
+ this.resolvedConfig.budokanAddress,
4338
+ provider
4339
+ );
4340
+ return this.cachedBudokanContract;
4341
+ }
2468
4342
  // ---- API context ----
2469
4343
  get apiCtx() {
2470
4344
  return {
@@ -2546,11 +4420,20 @@ var BudokanClient = class {
2546
4420
  /**
2547
4421
  * Fetch a single tournament by its ID.
2548
4422
  * Supports RPC fallback when API is unavailable.
4423
+ *
4424
+ * On the RPC-fallback path, Custom distribution shares are populated via
4425
+ * a follow-up call to `tournament_distribution_shares(id)` so callers see
4426
+ * the same shape regardless of data source (the API/indexer path fills
4427
+ * shares from the `TournamentCreated` event).
2549
4428
  */
2550
4429
  async getTournament(tournamentId) {
2551
4430
  const rpcFallback = async () => {
2552
4431
  const contract = await this.getViewerContract();
2553
- return viewerTournamentDetail(contract, tournamentId);
4432
+ const tournament = await viewerTournamentDetail(contract, tournamentId);
4433
+ if (tournament) {
4434
+ await this.fillCustomSharesIfEmpty(tournament);
4435
+ }
4436
+ return tournament;
2554
4437
  };
2555
4438
  if (this.resolvedConfig.primarySource === "rpc") {
2556
4439
  return rpcFallback();
@@ -2566,6 +4449,48 @@ var BudokanClient = class {
2566
4449
  }
2567
4450
  }
2568
4451
  }
4452
+ /**
4453
+ * If the tournament's entry-fee distribution is `Custom` with an empty
4454
+ * shares array (the on-chain `tournament()` view returns empty spans by
4455
+ * design to keep the hot path small), fetch the shares via the
4456
+ * dedicated view and graft them back onto the distribution object.
4457
+ *
4458
+ * Detection is tolerant: the Distribution shape may appear as
4459
+ * `{ variant: { Custom: [] } }` or a flattened `{ Custom: [] }`
4460
+ * depending on the starknet.js version / serialization path.
4461
+ */
4462
+ async fillCustomSharesIfEmpty(tournament) {
4463
+ const dist = tournament.entryFee?.distribution;
4464
+ if (!dist || typeof dist !== "object") return;
4465
+ const bag = dist.variant ?? dist;
4466
+ const customValue = bag.Custom ?? bag.custom;
4467
+ if (!Array.isArray(customValue) || customValue.length > 0) return;
4468
+ try {
4469
+ const shares = await this.getTournamentDistributionShares(tournament.id);
4470
+ if (shares.length > 0) {
4471
+ bag.Custom = shares;
4472
+ }
4473
+ } catch {
4474
+ }
4475
+ }
4476
+ /**
4477
+ * Fetch the Custom distribution shares for a tournament via the Budokan
4478
+ * contract's `tournament_distribution_shares(id)` view.
4479
+ *
4480
+ * Returns an empty array for tournaments configured with
4481
+ * `Linear` / `Exponential` / `Uniform` distributions (those don't have a
4482
+ * shares array), and for tournaments without an entry fee.
4483
+ *
4484
+ * This is a direct RPC call — consumers going through the primary API
4485
+ * path typically don't need it, since the indexer sources Custom shares
4486
+ * from the `TournamentCreated` event and exposes them via
4487
+ * `getTournament()`'s `entryFee.distribution`. Use this when you need a
4488
+ * fresh on-chain read or you're operating in RPC-only mode.
4489
+ */
4490
+ async getTournamentDistributionShares(tournamentId) {
4491
+ const contract = await this.getBudokanContract();
4492
+ return budokanTournamentDistributionShares(contract, tournamentId);
4493
+ }
2569
4494
  /**
2570
4495
  * Fetch the leaderboard for a tournament.
2571
4496
  * Supports RPC fallback when API is unavailable.