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