//------------------------------------------------------------------------------
// <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 NftTransferStorage
    {
        
        // Substrate client for the storage calls.
        private SubstrateClientExt _client;
        
        public NftTransferStorage(SubstrateClientExt client)
        {
            this._client = client;
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftTransfer", "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>("NftTransfer", "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_transfer.pallet.EnumPalletLockedState)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftTransfer", "NextItemId"), 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.U32), typeof(Ajuna.NetApi.Model.Types.Primitive.U128)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftTransfer", "LockItemStatus"), 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,
                            Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, typeof(Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Ajuna.NetApi.Model.Types.Primitive.U128>), typeof(Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("NftTransfer", "HoldingAccount"), 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>("NftTransfer", "NftClaimants"), 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,
                            Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, typeof(Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Ajuna.NetApi.Model.Types.Primitive.U128>), typeof(Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32)));
        }
        
        /// <summary>
        /// >> OrganizerParams
        /// </summary>
        public static string OrganizerParams()
        {
            return RequestGenerator.GetStorage("NftTransfer", "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 = NftTransferStorage.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("NftTransfer", "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_transfer.pallet.EnumPalletLockedState> LockedState(CancellationToken token)
        {
            string parameters = NftTransferStorage.LockedStateParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumPalletLockedState>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> NextItemIdParams
        /// </summary>
        public static string NextItemIdParams(Ajuna.NetApi.Model.Types.Primitive.U32 key)
        {
            return RequestGenerator.GetStorage("NftTransfer", "NextItemId", 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>
        /// >> NextItemIdDefault
        /// Default value as hex string
        /// </summary>
        public static string NextItemIdDefault()
        {
            return "0x00000000000000000000000000000000";
        }
        
        /// <summary>
        /// >> NextItemId
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.U128> NextItemId(Ajuna.NetApi.Model.Types.Primitive.U32 key, CancellationToken token)
        {
            string parameters = NftTransferStorage.NextItemIdParams(key);
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.U128>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> LockItemStatusParams
        /// </summary>
        public static string LockItemStatusParams(Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Ajuna.NetApi.Model.Types.Primitive.U128> key)
        {
            return RequestGenerator.GetStorage("NftTransfer", "LockItemStatus", Ajuna.NetApi.Model.Meta.Storage.Type.Map, new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                        Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity,
                        Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, key.Value);
        }
        
        /// <summary>
        /// >> LockItemStatusDefault
        /// Default value as hex string
        /// </summary>
        public static string LockItemStatusDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> LockItemStatus
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus> LockItemStatus(Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Ajuna.NetApi.Model.Types.Primitive.U128> key, CancellationToken token)
        {
            string parameters = NftTransferStorage.LockItemStatusParams(key);
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> HoldingAccountParams
        /// </summary>
        public static string HoldingAccountParams()
        {
            return RequestGenerator.GetStorage("NftTransfer", "HoldingAccount", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> HoldingAccountDefault
        /// Default value as hex string
        /// </summary>
        public static string HoldingAccountDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> HoldingAccount
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> HoldingAccount(CancellationToken token)
        {
            string parameters = NftTransferStorage.HoldingAccountParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> NftClaimantsParams
        /// </summary>
        public static string NftClaimantsParams(Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Ajuna.NetApi.Model.Types.Primitive.U128> key)
        {
            return RequestGenerator.GetStorage("NftTransfer", "NftClaimants", Ajuna.NetApi.Model.Meta.Storage.Type.Map, new Ajuna.NetApi.Model.Meta.Storage.Hasher[] {
                        Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity,
                        Ajuna.NetApi.Model.Meta.Storage.Hasher.Identity}, key.Value);
        }
        
        /// <summary>
        /// >> NftClaimantsDefault
        /// Default value as hex string
        /// </summary>
        public static string NftClaimantsDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> NftClaimants
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> NftClaimants(Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Ajuna.NetApi.Model.Types.Primitive.U128> key, CancellationToken token)
        {
            string parameters = NftTransferStorage.NftClaimantsParams(key);
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32>(parameters, token);
            return result;
        }
    }
    
    public sealed class NftTransferCalls
    {
        
        /// <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(61, "NftTransfer", 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_transfer.pallet.EnumPalletLockedState locked_state)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(locked_state.Encode());
            return new Method(61, "NftTransfer", 1, "set_locked_state", byteArray.ToArray());
        }
    }
    
    public sealed class NftTransferConstants
    {
        
        /// <summary>
        /// >> MaxAssetEncodedSize
        ///  Maximum amount of bytes that an asset may be encoded as.
        /// </summary>
        public Ajuna.NetApi.Model.Types.Primitive.U32 MaxAssetEncodedSize()
        {
            var result = new Ajuna.NetApi.Model.Types.Primitive.U32();
            result.Create("0xC8000000");
            return result;
        }
        
        /// <summary>
        /// >> HoldingPalletId
        ///  The holding's pallet id, used for deriving its sovereign account identifier for the Nft
        ///  holding account.
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.frame_support.PalletId HoldingPalletId()
        {
            var result = new Bajun.Network.NET.NetApiExt.Generated.Model.frame_support.PalletId();
            result.Create("0x616A2F6E66747472");
            return result;
        }
    }
    
    public enum NftTransferErrors
    {
        
        /// <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>
        /// >> AssetSizeAboveEncodingLimit
        /// The given asset resulted in an encoded size larger that the defined encoding limit.
        /// </summary>
        AssetSizeAboveEncodingLimit,
        
        /// <summary>
        /// >> NftNotFound
        /// The given NFT id didn't match any entries for the specified collection.
        /// </summary>
        NftNotFound,
        
        /// <summary>
        /// >> NftAttributeMissing
        /// The given NFT id doesn't have the proper attribute set.
        /// </summary>
        NftAttributeMissing,
        
        /// <summary>
        /// >> NftNotOwned
        /// The given NFT is not owned by the requester.
        /// </summary>
        NftNotOwned,
        
        /// <summary>
        /// >> NftOutsideOfChain
        /// The given NFT is currently outside of the chain, transfer it back before attempting a
        /// restore.
        /// </summary>
        NftOutsideOfChain,
        
        /// <summary>
        /// >> AssetRestoreFailure
        /// The process of restoring an NFT into an Asset has failed.
        /// </summary>
        AssetRestoreFailure,
    }
}
