Trying out Solnet wallet verification

This commit is contained in:
Joseph Ferano 2022-05-16 22:43:01 +07:00
parent 6248f457aa
commit 3ad20f79cc
7 changed files with 78 additions and 22 deletions

View File

@ -61,14 +61,14 @@ let adminBot = new DiscordClient(adminConfig)
let hackerCommands = hackerBattleBot.UseSlashCommands()
//let jpegCommands = jpegBot.UseSlashCommands()
//let stealCommands = stealBot.UseSlashCommands()
//let inviterCommands = inviterBot.UseSlashCommands()
let inviterCommands = inviterBot.UseSlashCommands()
//let slotsCommands = slotsBot.UseSlashCommands()
let adminCommands = adminBot.UseSlashCommands()
hackerCommands.RegisterCommands<HackerBattle.HackerGame>(guild);
//jpegCommands.RegisterCommands<Store.JpegStore>(guild);
//stealCommands.RegisterCommands<Thief.StealGame>(guild);
//inviterCommands.RegisterCommands<InviteTracker.Inviter>(guild);
inviterCommands.RegisterCommands<InviteTracker.Inviter>(guild);
//slotsCommands.RegisterCommands<SlotMachine.SlotMachine>(guild);
adminCommands.RegisterCommands<Admin.AdminBot>(guild)

View File

@ -18,13 +18,13 @@
<Compile Include="PlayerInteractions.fs" />
<Compile Include="XP.fs" />
<Compile Include="Embeds.fs" />
<Compile Include="InviteTracker.fs" />
<Compile Include="Games\SlotMachine.fs" />
<Compile Include="Games\Thief.fs" />
<Compile Include="Games\RockPaperScissors.fs" />
<Compile Include="Games\Store.fs" />
<Compile Include="Games\Trainer.fs" />
<Compile Include="Games\HackerBattle.fs" />
<Compile Include="InviteTracker.fs" />
<Compile Include="Whitelist.fs" />
<Compile Include="Admin.fs" />
<Compile Include="Bot.fs" />

View File

@ -8,6 +8,8 @@ open DSharpPlus.EventArgs
open DSharpPlus.SlashCommands
open Degenz.Messaging
open Npgsql.FSharp
open Solnet.Rpc
open Solnet.Wallet
let connStr = GuildEnvironment.connectionString
let InviteRewardAmount = 100<GBT>
@ -372,13 +374,24 @@ let handleGuildMemberAdded _ (eventArgs : GuildMemberAddEventArgs) =
do! processNewUser eventArgs
} :> Task
let submitWhitelist (ctx : IDiscordContext) (address : string) =
task {
// BtshZ7oNB5tk5pVbDpsRCziZ1qwV7SMCJq1Pe3YbHZuo
let address = PublicKey(address)
if address.IsValid() && address.IsOnCurve() then
do! Messaging.sendSimpleResponse ctx "You provided a valid address"
else
do! Messaging.sendSimpleResponse ctx "This address is not valid"
return ()
} :> Task
type Inviter() =
inherit ApplicationCommandModule ()
// [<SlashCommand("recruit", "Recruit another user to this discord and earn rewards")>]
// member this.CreateInvite (ctx : InteractionContext) =
// showInviteMessage (DiscordInteractionContext ctx) "RecruitCommand"
//
[<SlashCommand("submit", "Test something")>]
member this.SubmitAddress (ctx : InteractionContext, [<Option("address", "Wallet address")>] address : string) =
submitWhitelist (DiscordInteractionContext ctx) address
// [<SlashCommand("recruited", "Get total invites from a specific user")>]
// member this.ListInvitedPeople (ctx : InteractionContext) =
// let ictx = DiscordInteractionContext ctx :> IDiscordContext

View File

@ -5,3 +5,4 @@ DSharpPlus.SlashCommands
dotenv.net
Npgsql.FSharp
mixpanel-csharp
Solnet.Rpc

View File

@ -13,3 +13,4 @@ nuget MongoDB.Driver
nuget dotenv.net 3.1.1
nuget Npgsql.FSharp
nuget mixpanel-csharp 5.0.0
nuget Solnet.Rpc

View File

@ -2,6 +2,7 @@ STORAGE: NONE
RESTRICTION: || (== net6.0) (== netstandard2.0) (== netstandard2.1)
NUGET
remote: https://api.nuget.org/v3/index.json
Chaos.NaCl.Standard (1.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
ConcurrentHashSet (1.3)
DnsClient (1.6)
Microsoft.Win32.Registry (>= 5.0)
@ -30,9 +31,16 @@ NUGET
System.Runtime.CompilerServices.Unsafe (>= 5.0)
System.ValueTuple (>= 4.5)
FSharp.Core (6.0.3)
Microsoft.Bcl.AsyncInterfaces (6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1)
Microsoft.Bcl.AsyncInterfaces (6.0) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461))
Microsoft.Bcl.HashCode (1.1.1) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.Extensions.Configuration (6.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
Microsoft.Extensions.Primitives (>= 6.0)
Microsoft.Extensions.Configuration.Abstractions (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.Primitives (>= 6.0)
Microsoft.Extensions.Configuration.Binder (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
Microsoft.Extensions.DependencyInjection (6.0)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461))
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
@ -41,9 +49,42 @@ NUGET
Microsoft.Extensions.DependencyInjection.Abstractions (6.0)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461))
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461))
Microsoft.Extensions.Logging (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.DependencyInjection (>= 6.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
Microsoft.Extensions.Logging.Abstractions (>= 6.0)
Microsoft.Extensions.Options (>= 6.0)
System.Diagnostics.DiagnosticSource (>= 6.0)
Microsoft.Extensions.Logging.Abstractions (6.0.1)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0) (== netstandard2.1)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0) (== netstandard2.1)
Microsoft.Extensions.Logging.Configuration (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.Configuration (>= 6.0)
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
Microsoft.Extensions.Configuration.Binder (>= 6.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
Microsoft.Extensions.Logging (>= 6.0)
Microsoft.Extensions.Logging.Abstractions (>= 6.0)
Microsoft.Extensions.Options (>= 6.0)
Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0)
Microsoft.Extensions.Logging.Console (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
Microsoft.Extensions.Logging (>= 6.0)
Microsoft.Extensions.Logging.Abstractions (>= 6.0)
Microsoft.Extensions.Logging.Configuration (>= 6.0)
Microsoft.Extensions.Options (>= 6.0)
System.Text.Json (>= 6.0)
Microsoft.Extensions.Options (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
Microsoft.Extensions.Primitives (>= 6.0)
Microsoft.Extensions.Options.ConfigurationExtensions (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.Configuration.Abstractions (>= 6.0)
Microsoft.Extensions.Configuration.Binder (>= 6.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
Microsoft.Extensions.Options (>= 6.0)
Microsoft.Extensions.Primitives (>= 6.0)
Microsoft.Extensions.Primitives (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
System.Runtime.CompilerServices.Unsafe (>= 6.0)
Microsoft.NETCore.Platforms (6.0.2)
Microsoft.NETCore.Targets (5.0)
Microsoft.Win32.Primitives (4.3)
@ -88,6 +129,7 @@ NUGET
Ply (0.3.1)
FSharp.Core (>= 4.6.2)
System.Threading.Tasks.Extensions (>= 4.5.4)
Portable.BouncyCastle (1.9) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
@ -134,6 +176,13 @@ NUGET
SharpCompress (0.30.1)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461))
System.Text.Encoding.CodePages (>= 5.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1)
Solnet.Rpc (6.0.10)
Microsoft.Extensions.Logging (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Extensions.Logging.Console (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Solnet.Wallet (>= 6.0.10) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Solnet.Wallet (6.0.10) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Chaos.NaCl.Standard (>= 1.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Portable.BouncyCastle (>= 1.9) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
System.Buffers (4.5.1)
System.Collections (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
@ -158,7 +207,6 @@ NUGET
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Diagnostics.DiagnosticSource (6.0)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< net5.0)) (== netstandard2.0) (== netstandard2.1)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Diagnostics.Tracing (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
@ -328,7 +376,7 @@ NUGET
System.Threading (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Threading.Timer (>= 4.3)
System.Numerics.Vectors (4.5) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1)
System.Numerics.Vectors (4.5) - restriction: || (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.0)) (== netstandard2.0) (&& (== netstandard2.1) (< netstandard2.0))
System.Reflection (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
@ -487,18 +535,11 @@ NUGET
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Text.Encodings.Web (6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Text.Encodings.Web (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Json (6.0.2) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Numerics.Vectors (>= 4.5) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Text.Json (6.0.2)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Encodings.Web (>= 6.0)
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1)
System.Threading (4.3)
System.Runtime (>= 4.3)
System.Threading.Tasks (>= 4.3)