//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using Ajuna.NetApi;
using Ajuna.NetApi.Model.Extrinsics;
using Ajuna.NetApi.Model.Meta;
using Ajuna.NetApi.Model.Types;
using Ajuna.NetApi.Model.Types.Base;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;


namespace Bajun.Network.NET.NetApiExt.Generated.Storage
{
    
    
    public sealed class NftStakeStorage
    {
        
        // Substrate client for the storage calls.
        private SubstrateClientExt _client;
        
        public NftStakeStorage(SubstrateClientExt client)
        {
            this._client = client;
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "Organizer"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "LockedState"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_staking.pallet.EnumPalletLockedState)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "ActiveContracts"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                            Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, typeof(Ajuna.NetApi.Model.Types.Primitive.U128), typeof(Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_staking.contracts.StakingContract)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "ContractOwners"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                            Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, typeof(Ajuna.NetApi.Model.Types.Primitive.U128), typeof(Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "ContractDurations"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                            Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, typeof(Ajuna.NetApi.Model.Types.Primitive.U128), typeof(Ajuna.NetApi.Model.Types.Primitive.U32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "ContractStakedAssets"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                            Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, typeof(Ajuna.NetApi.Model.Types.Primitive.U128), typeof(Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec.BoundedVecT12)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "TreasuryAccount"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "ContractCollectionId"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Primitive.U32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftStake", "NextContractId"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Primitive.U128)));
        }
        
        /// <summary>
        /// >> OrganizerParams
        /// </summary>
        public static string OrganizerParams()
        {
            return RequestGenerator.GetStorage("NftStake", "Organizer", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> OrganizerDefault
        /// Default value as hex string
        /// </summary>
        public static string OrganizerDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> Organizer
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> Organizer(CancellationToken token)
        {
            string parameters = NftStakeStorage.OrganizerParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> LockedStateParams
        /// </summary>
        public static string LockedStateParams()
        {
            return RequestGenerator.GetStorage("NftStake", "LockedState", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> LockedStateDefault
        /// Default value as hex string
        /// </summary>
        public static string LockedStateDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> LockedState
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_staking.pallet.EnumPalletLockedState> LockedState(CancellationToken token)
        {
            string parameters = NftStakeStorage.LockedStateParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_staking.pallet.EnumPalletLockedState>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ActiveContractsParams
        /// </summary>
        public static string ActiveContractsParams(Ajuna.NetApi.Model.Types.Primitive.U128 key)
        {
            return RequestGenerator.GetStorage("NftStake", "ActiveContracts", Ajuna.NetApi.Model.Meta.Storage.Type.Map, new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                        Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, new Ajuna.NetApi.Model.Types.IType[] {
                        key});
        }
        
        /// <summary>
        /// >> ActiveContractsDefault
        /// Default value as hex string
        /// </summary>
        public static string ActiveContractsDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> ActiveContracts
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_staking.contracts.StakingContract> ActiveContracts(Ajuna.NetApi.Model.Types.Primitive.U128 key, CancellationToken token)
        {
            string parameters = NftStakeStorage.ActiveContractsParams(key);
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_staking.contracts.StakingContract>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ContractOwnersParams
        /// </summary>
        public static string ContractOwnersParams(Ajuna.NetApi.Model.Types.Primitive.U128 key)
        {
            return RequestGenerator.GetStorage("NftStake", "ContractOwners", Ajuna.NetApi.Model.Meta.Storage.Type.Map, new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                        Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, new Ajuna.NetApi.Model.Types.IType[] {
                        key});
        }
        
        /// <summary>
        /// >> ContractOwnersDefault
        /// Default value as hex string
        /// </summary>
        public static string ContractOwnersDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> ContractOwners
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> ContractOwners(Ajuna.NetApi.Model.Types.Primitive.U128 key, CancellationToken token)
        {
            string parameters = NftStakeStorage.ContractOwnersParams(key);
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ContractDurationsParams
        /// </summary>
        public static string ContractDurationsParams(Ajuna.NetApi.Model.Types.Primitive.U128 key)
        {
            return RequestGenerator.GetStorage("NftStake", "ContractDurations", Ajuna.NetApi.Model.Meta.Storage.Type.Map, new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                        Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, new Ajuna.NetApi.Model.Types.IType[] {
                        key});
        }
        
        /// <summary>
        /// >> ContractDurationsDefault
        /// Default value as hex string
        /// </summary>
        public static string ContractDurationsDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> ContractDurations
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.U32> ContractDurations(Ajuna.NetApi.Model.Types.Primitive.U128 key, CancellationToken token)
        {
            string parameters = NftStakeStorage.ContractDurationsParams(key);
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.U32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ContractStakedAssetsParams
        /// </summary>
        public static string ContractStakedAssetsParams(Ajuna.NetApi.Model.Types.Primitive.U128 key)
        {
            return RequestGenerator.GetStorage("NftStake", "ContractStakedAssets", Ajuna.NetApi.Model.Meta.Storage.Type.Map, new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                        Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, new Ajuna.NetApi.Model.Types.IType[] {
                        key});
        }
        
        /// <summary>
        /// >> ContractStakedAssetsDefault
        /// Default value as hex string
        /// </summary>
        public static string ContractStakedAssetsDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> ContractStakedAssets
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec.BoundedVecT12> ContractStakedAssets(Ajuna.NetApi.Model.Types.Primitive.U128 key, CancellationToken token)
        {
            string parameters = NftStakeStorage.ContractStakedAssetsParams(key);
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec.BoundedVecT12>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> TreasuryAccountParams
        /// </summary>
        public static string TreasuryAccountParams()
        {
            return RequestGenerator.GetStorage("NftStake", "TreasuryAccount", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> TreasuryAccountDefault
        /// Default value as hex string
        /// </summary>
        public static string TreasuryAccountDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> TreasuryAccount
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> TreasuryAccount(CancellationToken token)
        {
            string parameters = NftStakeStorage.TreasuryAccountParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ContractCollectionIdParams
        /// </summary>
        public static string ContractCollectionIdParams()
        {
            return RequestGenerator.GetStorage("NftStake", "ContractCollectionId", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> ContractCollectionIdDefault
        /// Default value as hex string
        /// </summary>
        public static string ContractCollectionIdDefault()
        {
            return "0x010C";
        }
        
        /// <summary>
        /// >> ContractCollectionId
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.U32> ContractCollectionId(CancellationToken token)
        {
            string parameters = NftStakeStorage.ContractCollectionIdParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.U32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> NextContractIdParams
        /// </summary>
        public static string NextContractIdParams()
        {
            return RequestGenerator.GetStorage("NftStake", "NextContractId", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> NextContractIdDefault
        /// Default value as hex string
        /// </summary>
        public static string NextContractIdDefault()
        {
            return "0x00000000000000000000000000000000";
        }
        
        /// <summary>
        /// >> NextContractId
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.U128> NextContractId(CancellationToken token)
        {
            string parameters = NftStakeStorage.NextContractIdParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.U128>(parameters, token);
            return result;
        }
    }
    
    public sealed class NftStakeCalls
    {
        
        /// <summary>
        /// >> set_organizer
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method SetOrganizer(Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 organizer)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(organizer.Encode());
            return new Method(62, "NftStake", 0, "set_organizer", byteArray.ToArray());
        }
        
        /// <summary>
        /// >> set_locked_state
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method SetLockedState(Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_staking.pallet.EnumPalletLockedState locked_state)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(locked_state.Encode());
            return new Method(62, "NftStake", 1, "set_locked_state", byteArray.ToArray());
        }
        
        /// <summary>
        /// >> fund_treasury
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method FundTreasury(Ajuna.NetApi.Model.Types.Primitive.U128 fund_amount)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(fund_amount.Encode());
            return new Method(62, "NftStake", 2, "fund_treasury", byteArray.ToArray());
        }
        
        /// <summary>
        /// >> submit_staking_contract
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method SubmitStakingContract(Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_staking.contracts.StakingContract staking_contract)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(staking_contract.Encode());
            return new Method(62, "NftStake", 3, "submit_staking_contract", byteArray.ToArray());
        }
        
        /// <summary>
        /// >> take_staking_contract
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method TakeStakingContract(Ajuna.NetApi.Model.Types.Primitive.U128 contract_id, Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec.BoundedVecT12 staked_assets)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(contract_id.Encode());
            byteArray.AddRange(staked_assets.Encode());
            return new Method(62, "NftStake", 4, "take_staking_contract", byteArray.ToArray());
        }
        
        /// <summary>
        /// >> redeem_staking_contract
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method RedeemStakingContract(Ajuna.NetApi.Model.Types.Primitive.U128 contract_id)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(contract_id.Encode());
            return new Method(62, "NftStake", 5, "redeem_staking_contract", byteArray.ToArray());
        }
    }
    
    public sealed class NftStakeConstants
    {
        
        /// <summary>
        /// >> TreasuryPalletId
        ///  The treasury's pallet id, used for deriving its sovereign account identifier.
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.frame_support.PalletId TreasuryPalletId()
        {
            var result = new Bajun.Network.NET.NetApiExt.Generated.Model.frame_support.PalletId();
            result.Create("0x616A2F6E66747374");
            return result;
        }
        
        /// <summary>
        /// >> MinimumStakingTokenReward
        ///  The minimal amount of tokens that can be rewarded in a staking contract.
        /// </summary>
        public Ajuna.NetApi.Model.Types.Primitive.U128 MinimumStakingTokenReward()
        {
            var result = new Ajuna.NetApi.Model.Types.Primitive.U128();
            result.Create("0x64000000000000000000000000000000");
            return result;
        }
        
        /// <summary>
        /// >> ContractCollectionConfig
        ///  The configuration for the contract Nft collection
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.CollectionConfig ContractCollectionConfig()
        {
            var result = new Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.CollectionConfig();
            result.Create("0x000000000000000000000000000000000000000000");
            return result;
        }
        
        /// <summary>
        /// >> ContractCollectionItemConfig
        ///  The configuration for the contract Nft collection
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.ItemConfig ContractCollectionItemConfig()
        {
            var result = new Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.ItemConfig();
            result.Create("0x0000000000000000");
            return result;
        }
    }
    
    public enum NftStakeErrors
    {
        
        /// <summary>
        /// >> OrganizerNotSet
        /// There is no account set as the organizer
        /// </summary>
        OrganizerNotSet,
        
        /// <summary>
        /// >> PalletLocked
        /// The pallet is currently locked and cannot be interacted with.
        /// </summary>
        PalletLocked,
        
        /// <summary>
        /// >> TreasuryLacksFunds
        /// The treasury doesn't have enough funds to pay the contract rewards.
        /// </summary>
        TreasuryLacksFunds,
        
        /// <summary>
        /// >> AccountLacksFunds
        /// Account doesn't have enough the minimum amount of funds necessary to contribute.
        /// </summary>
        AccountLacksFunds,
        
        /// <summary>
        /// >> ContractConditionsNotFulfilled
        /// The account that tried to take a staking contract failed to fulfill its conditions.
        /// </summary>
        ContractConditionsNotFulfilled,
        
        /// <summary>
        /// >> InvalidContractReward
        /// The contract reward is not valid. Either an invalid Nft or not enough tokens.
        /// </summary>
        InvalidContractReward,
        
        /// <summary>
        /// >> StakedAssetNotOwned
        /// The account that tried to take a staking contract didn't own one or more of the
        /// staked assets.
        /// </summary>
        StakedAssetNotOwned,
        
        /// <summary>
        /// >> ContractRewardNotOwned
        /// The account that tried to create a contract didn't actually own it's reward.
        /// </summary>
        ContractRewardNotOwned,
        
        /// <summary>
        /// >> ContractNotOwned
        /// The account that tried to redeemed a contract didn't own it
        /// </summary>
        ContractNotOwned,
        
        /// <summary>
        /// >> ContractTakenByOther
        /// The contract has been already taken by another account
        /// </summary>
        ContractTakenByOther,
        
        /// <summary>
        /// >> ContractAlreadyTaken
        /// The contract has been already taken by the account
        /// </summary>
        ContractAlreadyTaken,
        
        /// <summary>
        /// >> ContractStillActive
        /// The contract is still active, so it cannot be redeemed
        /// </summary>
        ContractStillActive,
        
        /// <summary>
        /// >> ContractNotFound
        /// The contract to be redeemed cannot be found
        /// </summary>
        ContractNotFound,
    }
}
