diff --git a/Krypton b/Krypton index 3e691c4..c94a582 160000 --- a/Krypton +++ b/Krypton @@ -1 +1 @@ -Subproject commit 3e691c4a190a53bc0bef247b747e1a8e308c92d2 +Subproject commit c94a582c6b4acc2c4d480859cf6c36529871fb75 diff --git a/README.md b/README.md index 9ad5223..2212f4b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Either use the ingame GUI editor on an advanced computer/turtle, or edit `config.lua` and change `branding.title` to the name of your shop you want shown in the header. -Next change `currencies.name`, and `currencies.pkey` for the krist currency to your krist address, the krist name you will be using (or nil), and your krist address' private key, respectively. If you are using a kristwallet format password, change `currencies.pkeyFormat` to `"kristwallet"`. You can then either remove/comment out the tenebra currency, or fill in your respective details for that. +Next change `currencies.name`, and `currencies.pkey` for the krist currency to your krist address, the krist name you will be using (or nil), and your krist address' private key, respectively. **Do not put your shop's title in `currencies.name`, just your ktrist name if you have one!** If you are using a kristwallet format password, change `currencies.pkeyFormat` to `"kristwallet"`. You can then either remove/comment out the tenebra currency, or fill in your respective details for that. **WARNING**: If you do not use a name for your shop, any transaction that doesn't purchase an item to your address will be refunded. Do not run the shop on your personal address you will be receiving krist to if you are not using a name. diff --git a/config.lua b/config.lua index 2774451..c1cfe32 100644 --- a/config.lua +++ b/config.lua @@ -230,19 +230,19 @@ currencies = { { id = "krist", -- if not krist or tenebra, must supply endpoint - -- node = "https://krist.dev" - name = nil, - pkey = nil, + -- node = "https://krist.dev/" + name = nil, -- Your krist name, usually ending in .kst + pkey = nil, -- Your private key, or password for kristwallet pkeyFormat = "raw", -- Currently must be 'raw' or 'kristwallet' -- You can get your raw pkey from kristweb or using https://pkey.its-em.ma/ value = 1.0 -- Default scaling on item prices, can be overridden on a per-item basis }, --[[{ id = "tenebra", -- if not krist or tenebra, must supply endpoint - -- node = "https://krist.dev" + -- node = "https://krist.dev/" host = "tttttttttt", - name = "radon.tst", - pkey = "", + name = "radon.tst", -- Your krist name, usually ending in .kst + pkey = nil, -- Your private key, or password for kristwallet pkeyFormat = "raw", -- Currently must be 'raw', kwallet support is planned -- You can get your raw pkey from kristweb or using https://pkey.its-em.ma/ value = 0.1 -- Default scaling on item prices, can be overridden on a per-item basis diff --git a/core/ShopState.lua b/core/ShopState.lua index 42343a8..31a45c2 100644 --- a/core/ShopState.lua +++ b/core/ShopState.lua @@ -203,15 +203,16 @@ node = node, id = currency.id, }) - table.insert(state.currencies, currency) - local kryptonWs = currency.krypton:connect() - kryptonWs:subscribe("ownTransactions") - kryptonWs:getSelf() local pkey = currency.pkey if currency.pkeyFormat == "kristwallet" then pkey = currency.krypton:toKristWalletFormat(currency.pkey) end currency.host = currency.krypton:makev2address(pkey) + currency.krypton.privateKey = pkey + table.insert(state.currencies, currency) + local kryptonWs = currency.krypton:connect() + kryptonWs:subscribe("ownTransactions") + kryptonWs:getSelf() if currency.name then local name = currency.name if name:find("%.") then diff --git a/core/schemas.lua b/core/schemas.lua index 524b21e..49efaa9 100644 --- a/core/schemas.lua +++ b/core/schemas.lua @@ -173,7 +173,7 @@ __entry = { id = "string", node = "string?", - name = "string?", + name = "regex<^[a-z0-9]{1,64}(\\.[a-z0-9]{1,64})?$>?: name", pkey = "string", pkeyFormat = "enum<'raw' | 'kristwallet'>: pkey format", value = "number?" diff --git a/radon.lua b/radon.lua index 53aeb18..56b7923 100644 --- a/radon.lua +++ b/radon.lua @@ -1,4 +1,4 @@ -local version = "1.3.8" +local version = "1.3.9" local configHelpers = require "util.configHelpers" local schemas = require "core.schemas" local oldPullEvent = os.pullEvent