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