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