Add API for Plugin Interoperability #7
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add API for Plugin Interoperability
Feature Request
Description
Create a public API that allows other Oxide plugins to interact with the Orangemart blood buying and Bitcoin sending system programmatically. This will enable developers to integrate Lightning Network payments and blood purchases into their own plugins without requiring players to use chat commands.
Motivation
Currently, the only way to interact with the system is through chat commands (
/buyblood
and//sendblood
). Other plugin developers have expressed interest in integrating with our system for features like:Proposed API Methods
1.
BuyBlood(ulong playerId, int amount)
playerId
: The SteamID of the playeramount
: Amount of blood items to purchaseDictionary<string, object>
containing:success
: bool - Whether invoice was created successfullyinvoiceId
: string - The payment hash for trackingbolt11
: string - The Lightning invoice for paymentamountSats
: int - The amount in satoshis2.
SendBitcoin(ulong playerId, string lightningAddress, int bloodAmount)
playerId
: The SteamID of the sending playerlightningAddress
: The Lightning address to send tobloodAmount
: Amount of blood items to convert and sendDictionary<string, object>
containing:success
: bool - Whether payment was initiatedpaymentHash
: string - The payment hash if successfulsatsAmount
: int - The amount sent in satoshiserror
: string - Error message if failed3.
GetPendingInvoice(string paymentHash)
paymentHash
: The payment hash to checkDictionary<string, object>
containing:exists
: bool - Whether invoice existsisPaid
: bool - Payment statustype
: string - "Currency", "Vip", or "SendBitcoin"amount
: int - Amount in the transaction4.
CancelInvoice(string paymentHash)
paymentHash
: The payment hash to cancelbool
- Success/failureExample Usage