commit
3fd538be3e
58
BOUNTY.md
Normal file
58
BOUNTY.md
Normal file
@ -0,0 +1,58 @@
|
||||
# orangemart.cs
|
||||
|
||||
**Exciting Developer Bounty: Create a uMod Plugin for Nostr Wallet Connect Integration!**
|
||||
|
||||
We are thrilled to announce an open-source project opportunity to create a plugin that will integrate Nostr Wallet Connect (NWC) into the popular game Rust. This plugin could revolutionize in-game commerce and server monetization, benefiting the entire Rust community, and we need passionate developers like you to bring it to life!
|
||||
|
||||
### About the Project
|
||||
Our goal is to develop a uMod (oxide) plugin that leverages NWC, as outlined in [NIP-47](https://github.com/nostr-protocol/nips/blob/master/47.md) of the Nostr protocol. If you’re new to Nostr, check out our detailed post [here](https://www.orangem.art/blog/nostr) to get started and learn more about the protocol [here](https://nostr.org/). NWC documentation is available [here](https://docs.nwc.dev/), and you can join the NWC developer Discord [here](https://discord.gg/PRhQPZCmeF).
|
||||
|
||||
The plugin will be server-side, built using the .NET Framework, and written in C#. Utilizing uMod’s capabilities, the plugin will dynamically enhance game functionality without requiring any client modifications. You can find uMod documentation [here](https://umod.org/documentation/api/overview) and join the uMod/Oxide developer Discord [here](https://discord.gg/HdhSD8aBXD), check out these guides from [@thethingtracks](https://medium.com/@thethingtracks/simple-rust-plugin-template-a0f405da8f64) and [kwamaking](https://github.com/kwamaking/rust-plugin-development). There is some NWC support in [NNostr](https://github.com/Kukks/NNostr) which is written in C# and could be a useful reference point.
|
||||
|
||||
"The cool thing with NWC is that it's quite easy to implement, no matter which language / tech stack you are using. It's basically sending some (signed & encrypted) JSON messages over a websocket connection." - [@reneaaron](https://stacker.news/items/640244/r/TheOrangeMart?commentId=640348)
|
||||
|
||||
### Initial Use Case
|
||||
**Server Wallet Integration:**
|
||||
- The server admin will input the NWC connection pairing secret into the plugin's configuration file.
|
||||
- The plugin will use this pairing secret to interact with the server's wallet.
|
||||
|
||||
**Player-to-Server Commerce Examples:**
|
||||
1. **Buying VIP Status:**
|
||||
- Players type /buyvip in-game.
|
||||
- The plugin requests an invoice from the server's wallet using NWC.
|
||||
- The invoice is displayed to the player as a QR code. Once paid, the player is added to the oxide permission group granting them VIP perks.
|
||||
- The configuration file allows customization of command name, price, and the Oxide permission group granted.
|
||||
|
||||
2. **Buying In-Game Currency:**
|
||||
- If the currency item is blood, players could type /buyblood and specify the amount they wish to purchase.
|
||||
- The plugin requests an invoice from the server's wallet and displays it to the player.
|
||||
- Once paid, the player receives the specified quantity of blood (1 blood = 1 sat).
|
||||
- The configuration file allows customization of currency item and command name.
|
||||
|
||||
3. **Selling In-Game Currency (sending):**
|
||||
- Players type /sendblood and provide a destination Lightning address.
|
||||
- The plugin deletes the specified amount of blood (currency item) from the player's inventory.
|
||||
- Using NWC, the plugin sends sats from the server's wallet to the destination address.
|
||||
|
||||
### Future Expansion Ideas
|
||||
**Player-to-Player Commerce:**
|
||||
- Enable the plugin to handle P2P commerce, enhancing in-game trading mechanics like the Vending Machine and less reliance on an in-game currency item. Possibly by allowing players to input their NWC connection pairing secret.
|
||||
|
||||
**Embedded Wallet:**
|
||||
- Utilize the Alby Hub's new isolated apps feature to give all players an embedded wallet. Join the Alby discord [here](https://discord.gg/4a79bPPgBW).
|
||||
|
||||
### Example Development Tasks:
|
||||
- Develop the plugin as a C# code file.
|
||||
- Ensure the plugin generates a JSON configuration file for customization.
|
||||
- Implement chat commands for buying and selling in-game currency.
|
||||
- Handle errors and notify players in chat with the lightning invoice.
|
||||
- Check invoice status and handle unsuccessful payments.
|
||||
|
||||
### Why Join Us?
|
||||
We have set aside **1 million sats ($650 USD at today’s value)** for the initial development and ongoing support of this plugin. Orangemart’s proof of funds can be found at our [Geyser Fundraiser](https://geyser.fund/project/orange), where we have received over **25 million sats** in donations from over 100 contributors. Additionally, proof of our disbursement of these funds to our community is available on the [Lightsats leaderboard](https://lightsats.com/leaderboard), where we have gifted over **10 million sats** in over 7000 prizes to our community.
|
||||
|
||||
This is a fantastic opportunity to contribute to an exciting project that could significantly impact the Rust community. Join our Discord to get started and collaborate with us on this thrilling journey: [Orangemart Discord](https://dsc.gg/orangemart).
|
||||
|
||||
Let’s build something amazing together! 🚀
|
||||
|
||||
Bounty originally published at [orangem.art](https://www.orangem.art/blog/nwcplugin)
|
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Patrick Ulrich
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
1125
Orangemart.cs
Normal file
1125
Orangemart.cs
Normal file
File diff suppressed because it is too large
Load Diff
138
README.md
138
README.md
@ -1,58 +1,112 @@
|
||||
# orangemart.cs
|
||||
## Overview:
|
||||
The **Orangemart** plugin allows players on your Rust server to buy and sell in-game units and VIP status using Bitcoin payments through the Lightning Network. This plugin integrates LNBits into the game, enabling secure transactions for game items and services.
|
||||
|
||||
**Exciting Developer Bounty: Create a uMod Plugin for Nostr Wallet Connect Integration!**
|
||||
---
|
||||
|
||||
We are thrilled to announce an open-source project opportunity to create a plugin that will integrate Nostr Wallet Connect (NWC) into the popular game Rust. This plugin could revolutionize in-game commerce and server monetization, benefiting the entire Rust community, and we need passionate developers like you to bring it to life!
|
||||
## Features
|
||||
|
||||
### About the Project
|
||||
Our goal is to develop a uMod (oxide) plugin that leverages NWC, as outlined in [NIP-47](https://github.com/nostr-protocol/nips/blob/master/47.md) of the Nostr protocol. If you’re new to Nostr, check out our detailed post [here](https://www.orangem.art/blog/nostr) to get started and learn more about the protocol [here](https://nostr.org/). NWC documentation is available [here](https://docs.nwc.dev/), and you can join the NWC developer Discord [here](https://discord.gg/PRhQPZCmeF).
|
||||
- **In-Game Currency Purchase:** Players can purchase in-game currency using Bitcoin payments.
|
||||
- **Send In-Game Currency:** Players can send currency to others, facilitating peer-to-peer transactions.
|
||||
- **VIP Status Purchase:** Players can purchase VIP status through Bitcoin payments, unlocking special privileges.
|
||||
- **Configurable:** Server admins can set up command names, currency items, prices, and more through the configuration file.
|
||||
|
||||
The plugin will be server-side, built using the .NET Framework, and written in C#. Utilizing uMod’s capabilities, the plugin will dynamically enhance game functionality without requiring any client modifications. You can find uMod documentation [here](https://umod.org/documentation/api/overview) and join the uMod/Oxide developer Discord [here](https://discord.gg/HdhSD8aBXD), check out these guides from [@thethingtracks](https://medium.com/@thethingtracks/simple-rust-plugin-template-a0f405da8f64) and [kwamaking](https://github.com/kwamaking/rust-plugin-development). There is some NWC support in [NNostr](https://github.com/Kukks/NNostr) which is written in C# and could be a useful reference point.
|
||||
---
|
||||
|
||||
"The cool thing with NWC is that it's quite easy to implement, no matter which language / tech stack you are using. It's basically sending some (signed & encrypted) JSON messages over a websocket connection." - [@reneaaron](https://stacker.news/items/640244/r/TheOrangeMart?commentId=640348)
|
||||
## Commands
|
||||
|
||||
### Initial Use Case
|
||||
**Server Wallet Integration:**
|
||||
- The server admin will input the NWC connection pairing secret into the plugin's configuration file.
|
||||
- The plugin will use this pairing secret to interact with the server's wallet.
|
||||
The following commands are available to players:
|
||||
|
||||
**Player-to-Server Commerce Examples:**
|
||||
1. **Buying VIP Status:**
|
||||
- Players type /buyvip in-game.
|
||||
- The plugin requests an invoice from the server's wallet using NWC.
|
||||
- The invoice is displayed to the player as a QR code. Once paid, the player is added to the oxide permission group granting them VIP perks.
|
||||
- The configuration file allows customization of command name, price, and the Oxide permission group granted.
|
||||
- **`/buyblood`**
|
||||
Players can purchase in-game currency using Bitcoin. The amount purchased is configurable.
|
||||
|
||||
2. **Buying In-Game Currency:**
|
||||
- If the currency item is blood, players could type /buyblood and specify the amount they wish to purchase.
|
||||
- The plugin requests an invoice from the server's wallet and displays it to the player.
|
||||
- Once paid, the player receives the specified quantity of blood (1 blood = 1 sat).
|
||||
- The configuration file allows customization of currency item and command name.
|
||||
- **`/sendblood <amount> <targetPlayer>`**
|
||||
Players can send a specified amount of in-game currency to another player.
|
||||
|
||||
3. **Selling In-Game Currency (sending):**
|
||||
- Players type /sendblood and provide a destination Lightning address.
|
||||
- The plugin deletes the specified amount of blood (currency item) from the player's inventory.
|
||||
- Using NWC, the plugin sends sats from the server's wallet to the destination address.
|
||||
- **`/buyvip`**
|
||||
Players can purchase VIP status using Bitcoin. The VIP price and associated permission group are configurable.
|
||||
|
||||
### Future Expansion Ideas
|
||||
**Player-to-Player Commerce:**
|
||||
- Enable the plugin to handle P2P commerce, enhancing in-game trading mechanics like the Vending Machine and less reliance on an in-game currency item. Possibly by allowing players to input their NWC connection pairing secret.
|
||||
---
|
||||
|
||||
**Embedded Wallet:**
|
||||
- Utilize the Alby Hub's new isolated apps feature to give all players an embedded wallet. Join the Alby discord [here](https://discord.gg/4a79bPPgBW).
|
||||
## Configuration
|
||||
|
||||
### Example Development Tasks:
|
||||
- Develop the plugin as a C# code file.
|
||||
- Ensure the plugin generates a JSON configuration file for customization.
|
||||
- Implement chat commands for buying and selling in-game currency.
|
||||
- Handle errors and notify players in chat with the lightning invoice.
|
||||
- Check invoice status and handle unsuccessful payments.
|
||||
Below is a list of key configuration variables that can be customized in the plugin:
|
||||
|
||||
### Why Join Us?
|
||||
We have set aside **1 million sats ($650 USD at today’s value)** for the initial development and ongoing support of this plugin. Orangemart’s proof of funds can be found at our [Geyser Fundraiser](https://geyser.fund/project/orange), where we have received over **25 million sats** in donations from over 100 contributors. Additionally, proof of our disbursement of these funds to our community is available on the [Lightsats leaderboard](https://lightsats.com/leaderboard), where we have gifted over **10 million sats** in over 7000 prizes to our community.
|
||||
- **`CurrencyItemID`**
|
||||
The item ID used for in-game currency transactions.
|
||||
|
||||
This is a fantastic opportunity to contribute to an exciting project that could significantly impact the Rust community. Join our Discord to get started and collaborate with us on this thrilling journey: [Orangemart Discord](https://dsc.gg/orangemart).
|
||||
- **`BuyCurrencyCommandName`**
|
||||
The name of the command players use to buy in-game currency.
|
||||
|
||||
Let’s build something amazing together! 🚀
|
||||
- **`SendCurrencyCommandName`**
|
||||
The name of the command players use to send in-game currency to other players.
|
||||
|
||||
Bounty originally published at [orangem.art](https://www.orangem.art/blog/nwcplugin)
|
||||
- **`BuyVipCommandName`**
|
||||
The name of the command players use to purchase VIP status.
|
||||
|
||||
- **`VipPrice`**
|
||||
The price (in satoshis) for players to purchase VIP status.
|
||||
|
||||
- **`VipPermissionGroup`**
|
||||
The Oxide permission group that VIP players are added to.
|
||||
|
||||
- **`CurrencyName`**
|
||||
The name of the in-game currency.
|
||||
|
||||
- **`SatsPerCurrencyUnit`**
|
||||
The conversion rate between satoshis and in-game currency units.
|
||||
|
||||
- **`PricePerCurrencyUnit`**
|
||||
The price (in satoshis) per unit of in-game currency.
|
||||
|
||||
- **`CheckIntervalSeconds`**
|
||||
Interval time (in seconds) for checking pending Bitcoin transactions.
|
||||
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
1. **Download the Plugin**
|
||||
Place the `Orangemart.cs` file in your server's `oxide/plugins` folder.
|
||||
|
||||
2. **Configuration**
|
||||
Modify the plugin’s configuration file to fit your server’s settings (currency item, prices, VIP group, etc.). The configuration file will be automatically generated upon running the plugin for the first time.
|
||||
|
||||
3. **Create VIP Group (Optional)**
|
||||
Create a VIP group to assign permssions to.
|
||||
|
||||
4. **Reload the Plugin**
|
||||
Once configured, reload the plugin using the command:
|
||||
```
|
||||
oxide.reload Orangemart
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Permissions
|
||||
|
||||
The plugin uses the following permissions:
|
||||
|
||||
- **`orangemart.buycurrency`**
|
||||
Grants permission to players who are allowed to buy your currency item via Bitcoin.
|
||||
|
||||
- **`orangemart.sendcurrency`**
|
||||
Grants permission to players who are allowed to send Bitcoin for your in-game currency unit.
|
||||
|
||||
- **`orangemart.buyvip`**
|
||||
Grants permission to players to purchase VIP via Bitcoin.
|
||||
|
||||
---
|
||||
|
||||
## Logging and Troubleshooting
|
||||
|
||||
- **Logs:**
|
||||
Transaction details, such as purchases and currency sends, are logged for auditing purposes. Logs can be found in the `oxide/data/Orangemart` directory.
|
||||
|
||||
- **Troubleshooting:**
|
||||
If any issues arise, check the server logs for errors related to the plugin. Ensure that the configuration file is correctly set up and that Bitcoin payment services are running as expected.
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
This plugin is licensed under the MIT License.
|
||||
|
@ -1,24 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Oxide.Core;
|
||||
using Oxide.Core.Plugins;
|
||||
using Oxide.Game.Rust.Cui;
|
||||
using Oxide.Core.Libraries.Covalence;
|
||||
namespace Oxide.Plugins
|
||||
{
|
||||
[Info("Plugin Name", "Author/s", "0.0.1")]
|
||||
[Description("One sentence plugin description.")]
|
||||
class PluginName : CovalencePlugin
|
||||
{
|
||||
private void OnServerInitialized()
|
||||
{
|
||||
AddCovalenceCommand("ping", "PingPong");
|
||||
}
|
||||
private void PingPong(IPlayer player, string command, string[] args)
|
||||
{
|
||||
player.Reply("Pong");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user