Type the payee address before releasing payments in the Web3 page
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4645c5a97d
commit
2d3302a2f7
7 files changed
+108
-13
No files matched your search
@@ -30,6 +30,7 @@
|
||||
- 订单改成商家货架(用户意见):黑市页"订单"改名"商家",每周从 6 种类型里抽 5 家(全新矿卡经销商、二手矿卡贩子、模组高科技、军火、证件芯片、药物),另有 25% 的周出现一家大宗商家(库存 10–25 件、价格系数 0.55–0.75、送货 6 天)。每家有自己的价格系数(订单价 = 基础价 × 系数,一般 0.70–0.95,全新卡 0.85–1.00,二手卡 0.65–0.90),每家 4 种货、库存 3–6 件。一次订 5 件以上 95 折、10 件以上 9 折。界面:件数按钮 ×1 / ×5 / ×10,商家按钮,所选商家的货架。药物(药片、梦尘、管制化学品)只在药物商家和大宗商家出现,也能转手出售。每周货架总值在游戏里抽样 60 周平均 13.2k(目标 1.4 万)。
|
||||
- 商家类型扩到 18 种 + 大宗(用户意见,对照游戏的物品目录和玩家职业):全新矿卡经销商、二手矿卡贩子、矿架与能源、模组、军火(枪、手雷、炸药、刀具、电击枪)、枪匠配件(枪械配件、3D 打印芯片与模组、枪械零件)、证件芯片、药物(药片、注射器、血袋、手术工具)、化学品(化学用品、助熔剂、化学设备模组、量筒试剂瓶)、酿酒(酵母、荧光莓、啤酒、酒瓶)、水培农场(种子、水培模组、植物分析仪)、养殖(鱼卵、鱼子酱、循环水养殖系统、血清、屠宰机)、矿工(矿石、金属锭、电子元件、拾荒扫描仪)、水务(滤水、净水、储水、检测)、仓储(走私暗格、储藏区扩建、军用背包)、工具(涡轮增压器、等离子切割机、X 射线扫描仪、心智重编程器)、奢侈品(香水、精华液、香烟)。每周 7 家:2 家从矿卡 / 矿架 / 模组 4 类里抽(保证矿工路线总有货),其余 5 家从其余类型里抽;每家 3 种货,库存 2–5 件,单件基础价超过 4000 的不上。游戏里抽样 60 周货架总值平均 13.2k(目标 1.4 万)。药物改成并入药物商家,现货柜台的货不变。所有货都能转手出售。
|
||||
- 尖端店铺与个人卖家(用户意见):贵货(单件基础价 ≥ 2000:超科技涡轮增压器、超科技储藏区、心智重编程器、顶级显卡等)不再被一刀切掉,改由"尖端店铺"卖:每周只有 15% 的概率出现,2 种货、库存 1–2 件、价格系数 0.85–1.00、送货 5 天;顶级全新显卡也在这里。个人卖家:每周固定 2 位,什么都卖(可能是药、模组、显卡、仍有 10% 混进贵货),每件价格系数各自随机 0.50–1.20(捡漏或被宰),库存 1–2 件,是骗子的概率 25%,都是新号所以只接受托管。常规商家仍只卖基础价 ≤ 4000 的货。
|
||||
- 手输收款地址(用户意见):Web3 里的付款与转账——黑市现货、商家下单、上架费、混币器存入、Ponero 兑换——点下去先出"确认付款"页,显示摘要和收款地址(商家是名字里的 0x… ,平台、混币器、Ponero 兑换处各有自己的随机地址,存档保存),要手输地址才放款,不分大小写,输错提示"地址不符,没有付款",可取消。DEX 兑换和银行存取不加(没有收款方);交易所的转账等阶段 5 多钱包时再接同一个确认页。游戏内验证:现货买超频模组,输错一位被拒、输对成交;Ponero 兑换处进入确认页。
|
||||
- 商家名用随机哈希匿名,前面用方括号标类型(用户意见,试过每类型 10 个主题店名后撤回):如 "[全新矿卡] 0xdf9ec7";选中的商家按钮前有 "> "。
|
||||
- 每周货架总值放宽到 2 万左右(用户意见):库存范围 2–5 → 2–6,游戏里抽样 60 周平均 22.2k,尖端店铺出现概率保持 15% 不变,不靠它拉高周转量。
|
||||
- 同时上架最多 10 件(用户意见),出售页显示"上架 n/10",超出时提示。
|
||||
|
||||
@@ -201,7 +201,12 @@ namespace Decentralized
|
||||
var d = Session.Data;
|
||||
foreach (var o in d.Black.Ready.Where(x => !x.Controlled).ToList())
|
||||
{
|
||||
for (int i = 0; i < o.Count; i++) Items.Give(Make(o.Item, o.Model, o.FakeOf, o.Health));
|
||||
for (int i = 0; i < o.Count; i++)
|
||||
{
|
||||
var made = Make(o.Item, o.Model, o.FakeOf, o.Health);
|
||||
Items.Give(made);
|
||||
if (o.Item.StartsWith("gpu:")) { var u = Items.ToUnit(made); Log.Info($"黑市到货显卡:标称 {u.Model} 真身 {(u.FakeOf ?? "(真卡)")} 成色 {u.Health:0} 外观 {u.Look.Encode()}"); }
|
||||
}
|
||||
d.Black.Deliver(o);
|
||||
Log.Info($"黑市快递:{o.Item} ×{o.Count}{(o.FakeOf != null ? "(假卡,真身 " + o.FakeOf + ")" : "")} 已放进储藏区");
|
||||
}
|
||||
|
||||
@@ -81,6 +81,34 @@ namespace Decentralized
|
||||
d.Black.RefreshOrders(StoreStation.GetDayCounter(), StoreReputation.GetBMReputation(), d.Rng, BlackDelivery.Value, true);
|
||||
Log.Info($"黑市全部商家(测试):{d.Black.Sellers.Count} 家,货架 {d.Black.Catalog.Count} 种,{string.Join("/", d.Black.Sellers.Select(x => x.Type))}");
|
||||
}));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Black market negative cases (test)", () => Log.Guard("黑市负面场景(测试)", () =>
|
||||
{
|
||||
var d = Session.Data;
|
||||
int day = StoreStation.GetDayCounter();
|
||||
d.Black.RefreshOrders(day, StoreReputation.GetBMReputation(), d.Rng, BlackDelivery.Value, true);
|
||||
var w = d.Hot;
|
||||
w.Add(Assets.CRT, 20000);
|
||||
BmListing First(MerchantType t) => d.Black.Catalog.First(l => d.Black.Sellers[l.Seller].Type == t);
|
||||
// 骗子(老号,接受提前放款):二手矿卡;诚实:全新矿卡;诚实二手卡里夹假卡
|
||||
var scamUsed = First(MerchantType.GpuUsed);
|
||||
var sUsed = d.Black.Sellers[scamUsed.Seller]; sUsed.Scam = true; sUsed.Trades = 120; sUsed.Rating = 97;
|
||||
var honest = First(MerchantType.GpuNew);
|
||||
d.Black.Sellers[honest.Seller].Scam = false; d.Black.Sellers[honest.Seller].Trades = 150;
|
||||
foreach (var s in d.Black.Sellers.Where(x => x.Type == MerchantType.Personal)) s.Scam = true;
|
||||
var fakeL = First(MerchantType.Modules);
|
||||
var fakeCard = new BmListing { Seller = d.Black.Sellers.FindIndex(x => x.Type == MerchantType.Modules), Item = "gpu:RTX70", Kind = GoodKind.Gpu, Level = 2, Model = "RTX70", FakeOf = "RTX60", Health = 55, Price = 500, Qty = 5 };
|
||||
d.Black.Sellers[fakeCard.Seller].Scam = false; d.Black.Sellers[fakeCard.Seller].Trades = 150;
|
||||
d.Black.Catalog.Add(fakeCard);
|
||||
var persL = d.Black.Catalog.First(l => d.Black.Sellers[l.Seller].Type == MerchantType.Personal);
|
||||
d.Black.HoneypotUntil = day + 6;
|
||||
int before = d.Black.Orders.Count;
|
||||
var o1 = d.Black.Place(scamUsed, 1, PayMode.Escrow, w, Assets.CRT, day, Session.Price); // 骗子 + 托管 → 退款
|
||||
var o2 = d.Black.Place(scamUsed, 1, PayMode.Advance, w, Assets.CRT, day, Session.Price); // 骗子 + 提前放款 → 钱没了
|
||||
var o3 = d.Black.Place(fakeCard, 2, PayMode.Escrow, w, Assets.CRT, day, Session.Price); // 假卡
|
||||
var o4 = d.Black.Place(persL, 1, PayMode.Advance, w, Assets.CRT, day, Session.Price); // 个人卖家不接受提前放款 → null
|
||||
var o5 = d.Black.Place(persL, 1, PayMode.Escrow, w, Assets.CRT, day, Session.Price); // 个人卖家(骗子)+ 托管
|
||||
Log.Info($"负面场景:下单 骗子托管={o1 != null} 骗子提前={o2 != null} 假卡={o3 != null} 个人提前={o4 != null}(应为 False)个人托管={o5 != null},蜜罐至第 {d.Black.HoneypotUntil} 天,追查 {d.Black.Traps.Count} 笔,钱包 CRT {w.Get(Assets.CRT):0} 污点 {w.Taint:0}");
|
||||
}));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Black market events (test)", () => Log.Guard("黑市事件(测试)", () =>
|
||||
{
|
||||
var d = Session.Data;
|
||||
|
||||
@@ -270,7 +270,7 @@ black.kind.Contraband.3,Contraband (high)
|
||||
black.kind.Tech,High-tech (markup)
|
||||
nightlog.bm.ready,"Black market: {0} arrived; a courier will come by once you open."
|
||||
item.web3guide.name,Web3 Handbook
|
||||
item.web3guide.desc,"Bank: depositing turns credits into CRC; withdrawing turns CRC back into credits and goes through compliance screening. Trading: buys are paid in the quote coin, sells in the traded coin. Mixer: pick a coin, amount and rounds; each round takes a fee and lowers taint, rounds equal days of waiting, and the coins come back to the same address; the more you deposit, the worse the cleaning. Black market: coin only, no CRC, 30% above normal channels, with extra markup on high-tech goods and GPUs; the coin you pay leaves its share of taint with the seller and the goods carry no stolen tag; GPUs may be fake, inspect them yourself. Orders are cheaper than spot but take days and may be intercepted; merchants sell by type at their own price factor, 5+ items get 5% off and 10+ get 10% off, and a bulk merchant appears at random with the lowest prices but six days of waiting; escrow costs 5%, is released on delivery and refunded if the seller runs; advance release takes another 10% off, but a scammer keeps the money and only sellers with 30+ trades accept; the platform itself can rug, be taken over by enforcement, or a seller can be arrested, after which your orders get traced and crime logged; forum rumors can be warnings. An intercepted parcel sometimes turns into enforcement at your door: signing logs the crime on the spot and seizes the goods, refusing only costs the payment. Selling: on the black market's Sell page, list contraband, high-tech goods and GPUs from storage at 0.6x to 1.8x the reference price. The higher the multiplier, the slower the sale (below 0.9x about a day, 1.0x about two, 1.8x about fourteen), and the likelier and larger the taint on the payout, which also grows with how much you sold in the last 7 days; at most 10 listings at a time, 5% listing fee, 8% commission, payout held 3 days before reaching your wallet; a fake card may be spotted and returned, hurting your rating; if the platform rugs, listed goods and unreleased payouts are gone. Ponero desk: Ponero is a privacy coin and swapping in wipes the taint on that value; 6% fee each way with a daily limit; coin swapped out of Ponero has no origin and cash-out screening gets stricter."
|
||||
item.web3guide.desc,"Bank: depositing turns credits into CRC; withdrawing turns CRC back into credits and goes through compliance screening. Trading: buys are paid in the quote coin, sells in the traded coin. Mixer: pick a coin, amount and rounds; each round takes a fee and lowers taint, rounds equal days of waiting, and the coins come back to the same address; the more you deposit, the worse the cleaning. Payments and transfers (black market, mixer, Ponero desk, listing fees) require typing the payee address (the 0x string in the merchant name, or the platform's own) and a wrong address pays nothing. Black market: coin only, no CRC, 30% above normal channels, with extra markup on high-tech goods and GPUs; the coin you pay leaves its share of taint with the seller and the goods carry no stolen tag; GPUs may be fake, inspect them yourself. Orders are cheaper than spot but take days and may be intercepted; merchants sell by type at their own price factor, 5+ items get 5% off and 10+ get 10% off, and a bulk merchant appears at random with the lowest prices but six days of waiting; escrow costs 5%, is released on delivery and refunded if the seller runs; advance release takes another 10% off, but a scammer keeps the money and only sellers with 30+ trades accept; the platform itself can rug, be taken over by enforcement, or a seller can be arrested, after which your orders get traced and crime logged; forum rumors can be warnings. An intercepted parcel sometimes turns into enforcement at your door: signing logs the crime on the spot and seizes the goods, refusing only costs the payment. Selling: on the black market's Sell page, list contraband, high-tech goods and GPUs from storage at 0.6x to 1.8x the reference price. The higher the multiplier, the slower the sale (below 0.9x about a day, 1.0x about two, 1.8x about fourteen), and the likelier and larger the taint on the payout, which also grows with how much you sold in the last 7 days; at most 10 listings at a time, 5% listing fee, 8% commission, payout held 3 days before reaching your wallet; a fake card may be spotted and returned, hurting your rating; if the platform rugs, listed goods and unreleased payouts are gone. Ponero desk: Ponero is a privacy coin and swapping in wipes the taint on that value; 6% fee each way with a daily limit; coin swapped out of Ponero has no origin and cash-out screening gets stricter."
|
||||
courier.odd1,...Package is here.
|
||||
courier.odd2,"(His hand stays in his pocket.) Sign here."
|
||||
courier.sign,Sign
|
||||
@@ -334,3 +334,13 @@ merchant.Luxury,Luxury
|
||||
black.kind.Goods,Goods
|
||||
merchant.Elite,Elite shop
|
||||
merchant.Personal,Private seller
|
||||
black.pay.confirm,Confirm payment
|
||||
black.pay.item,"{0} {1} credits"
|
||||
black.pay.to,"Payee address: {0}"
|
||||
black.pay.input,Type the payee address
|
||||
black.pay.go,Release payment
|
||||
black.pay.cancel,Cancel
|
||||
black.pay.bad,Address does not match; nothing paid.
|
||||
pay.mix,"Mixer {0} {1}"
|
||||
pay.swap,"Ponero desk {0} {1}"
|
||||
pay.listfee, (listing fee)
|
||||
|
@@ -269,7 +269,7 @@ black.kind.Contraband.3,违禁品(高)
|
||||
black.kind.Tech,高科技物品(加价)
|
||||
nightlog.bm.ready,"黑市:{0} 到货,开店后会有快递员上门。"
|
||||
item.web3guide.name,Web3 手册
|
||||
item.web3guide.desc,"银行:存入把信用点换成 CRC;提取把 CRC 换回信用点,提取要过合规审查。交易:买入按计价币的数量支付,卖出按所交易币的数量卖出。混币器:选币种、填数量和轮数,每轮扣手续费并降低污点,轮数即等待天数,到期提回同一个地址;存入越多,清洗越差。黑市:只收币,不收 CRC,价格比正常渠道贵 30%,高科技物品和显卡另有加价;付出去的币带着按比例的污点留在卖家那边,货不带赃物标签;显卡不保证真假,自己鉴定。订单比现货便宜,要等几天,路上可能被截获;商家按类型卖货,价格系数各不相同,一次订 5 件以上 95 折、10 件以上 9 折,大宗商家随机出现,价格最低但要等六天;托管多付 5% 托管费,收货后放款,卖家跑路时退款;提前放款再打九折,卖家若是骗子钱就没了,只有成交 30 单以上的卖家接受;平台自己也可能跑路,也可能被执法接管,或者卖家落网,之后你的订单会被追查、记罪证;论坛上的传闻可以当预兆。被截获的包裹有时会变成执法人员上门:签收当场记罪证并查封,拒签只损失货款。出售:在黑市的出售页把储藏区里的违禁品、高科技物品和显卡上架,标价是参考价的 0.6 到 1.8 倍。倍率越高成交越慢(0.9 以下约一天,1.0 约两天,1.8 约十四天),货款带污点的可能性和比例也越高,近 7 天出售的量越大,污点越重;同时最多上架 10 件,上架收 5% 上架费,成交扣 8% 抽成,货款托管 3 天后进钱包;卖假卡可能被买家看穿而退货,拉低好评;平台跑路时上架的货和未放款的货款都没了。Ponero 兑换处:Ponero 是隐私币,兑入时这部分价值的污点被清除;兑入、兑出各收 6% 手续费,每天有额度;从 Ponero 兑出的币来路不明,出金审查会加重。"
|
||||
item.web3guide.desc,"银行:存入把信用点换成 CRC;提取把 CRC 换回信用点,提取要过合规审查。交易:买入按计价币的数量支付,卖出按所交易币的数量卖出。混币器:选币种、填数量和轮数,每轮扣手续费并降低污点,轮数即等待天数,到期提回同一个地址;存入越多,清洗越差。付款与转账(黑市、混币器、Ponero 兑换处、上架费)前要手输收款地址(商家名里的 0x 开头那串,或平台自己的地址),输错不会付款。黑市:只收币,不收 CRC,价格比正常渠道贵 30%,高科技物品和显卡另有加价;付出去的币带着按比例的污点留在卖家那边,货不带赃物标签;显卡不保证真假,自己鉴定。订单比现货便宜,要等几天,路上可能被截获;商家按类型卖货,价格系数各不相同,一次订 5 件以上 95 折、10 件以上 9 折,大宗商家随机出现,价格最低但要等六天;托管多付 5% 托管费,收货后放款,卖家跑路时退款;提前放款再打九折,卖家若是骗子钱就没了,只有成交 30 单以上的卖家接受;平台自己也可能跑路,也可能被执法接管,或者卖家落网,之后你的订单会被追查、记罪证;论坛上的传闻可以当预兆。被截获的包裹有时会变成执法人员上门:签收当场记罪证并查封,拒签只损失货款。出售:在黑市的出售页把储藏区里的违禁品、高科技物品和显卡上架,标价是参考价的 0.6 到 1.8 倍。倍率越高成交越慢(0.9 以下约一天,1.0 约两天,1.8 约十四天),货款带污点的可能性和比例也越高,近 7 天出售的量越大,污点越重;同时最多上架 10 件,上架收 5% 上架费,成交扣 8% 抽成,货款托管 3 天后进钱包;卖假卡可能被买家看穿而退货,拉低好评;平台跑路时上架的货和未放款的货款都没了。Ponero 兑换处:Ponero 是隐私币,兑入时这部分价值的污点被清除;兑入、兑出各收 6% 手续费,每天有额度;从 Ponero 兑出的币来路不明,出金审查会加重。"
|
||||
courier.odd1,……东西到了。
|
||||
courier.odd2,"(他的手一直放在口袋里)在这儿签个字。"
|
||||
courier.sign,签收
|
||||
@@ -333,3 +333,13 @@ merchant.Luxury,奢侈品
|
||||
black.kind.Goods,商品
|
||||
merchant.Elite,尖端店铺
|
||||
merchant.Personal,个人卖家
|
||||
black.pay.confirm,确认付款
|
||||
black.pay.item,"{0} {1} 信用点等值"
|
||||
black.pay.to,"收款地址:{0}"
|
||||
black.pay.input,输入收款地址
|
||||
black.pay.go,放款
|
||||
black.pay.cancel,取消
|
||||
black.pay.bad,地址不符,没有付款。
|
||||
pay.mix,"混币器 {0} {1}"
|
||||
pay.swap,"Ponero 兑换处 {0} {1}"
|
||||
pay.listfee,(上架费)
|
||||
|
@@ -30,6 +30,14 @@ namespace Decentralized
|
||||
public List<MarketEvent> ActiveEvents = new List<MarketEvent>();
|
||||
public NightReport LastNight;
|
||||
public bool OpeningNewsShown;
|
||||
/// <summary>各个收款方的地址(平台、混币器、Ponero 兑换处等),第一次用到时随机生成并存档。付款前要手输。</summary>
|
||||
public Dictionary<string, string> Addresses = new Dictionary<string, string>();
|
||||
|
||||
public string Address(string key)
|
||||
{
|
||||
if (!Addresses.TryGetValue(key, out var a)) { a = "0x" + Rng.NextUInt().ToString("x8").Substring(0, 6); Addresses[key] = a; }
|
||||
return a;
|
||||
}
|
||||
/// <summary>当天用币付款的成交额(信用点),夜间清零。</summary>
|
||||
public double CoinSalesToday;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@ namespace Decentralized
|
||||
private enum Page { Home, Bank, Poinbase, Web3 }
|
||||
|
||||
private static Page _page = Page.Home;
|
||||
private sealed class PendingPay { public string Address, Summary; public int Total; public Action Execute; }
|
||||
private static PendingPay _pay;
|
||||
private static string _addr = "";
|
||||
private static string _amount = "";
|
||||
private static string _message;
|
||||
|
||||
@@ -30,7 +33,7 @@ namespace Decentralized
|
||||
{
|
||||
var page = p;
|
||||
string name = L.T("tab." + p.ToString().ToLowerInvariant());
|
||||
b.AddButton(page == _page ? $"[{name}]" : name, () => { _page = page; _message = null; Open(); });
|
||||
b.AddButton(page == _page ? $"[{name}]" : name, () => { _page = page; _message = null; _pay = null; Open(); });
|
||||
}
|
||||
b.End();
|
||||
b.AddSeparator();
|
||||
@@ -48,7 +51,7 @@ namespace Decentralized
|
||||
b.Show();
|
||||
}
|
||||
|
||||
private static void Go(Page p) { _page = p; _message = null; Open(); }
|
||||
private static void Go(Page p) { _page = p; _message = null; _pay = null; Open(); }
|
||||
|
||||
private static void Entry(CustomUIBuilder b, string icon, string name, string line1, string line2, Page target)
|
||||
{
|
||||
@@ -235,6 +238,7 @@ namespace Decentralized
|
||||
private static void Web3Page(CustomUIBuilder b)
|
||||
{
|
||||
var w = Session.Data.Hot;
|
||||
if (_pay != null) { PayPage(b); return; }
|
||||
{
|
||||
if (_web3Tab == Web3Tab.Mixer && !Unlock.MixerUnlocked) _web3Tab = Web3Tab.Trade;
|
||||
if (_web3Tab == Web3Tab.Black && !Unlock.BlackUnlocked) _web3Tab = Web3Tab.Trade;
|
||||
@@ -244,7 +248,7 @@ namespace Decentralized
|
||||
if ((t == Web3Tab.Mixer && !Unlock.MixerUnlocked) || (t == Web3Tab.Black && !Unlock.BlackUnlocked)) continue;
|
||||
var tab = t;
|
||||
string name = L.T("web3.sub." + t.ToString().ToLowerInvariant());
|
||||
b.AddButton(tab == _web3Tab ? $"[{name}]" : name, () => { _web3Tab = tab; _message = null; Open(); });
|
||||
b.AddButton(tab == _web3Tab ? $"[{name}]" : name, () => { _web3Tab = tab; _message = null; _pay = null; Open(); });
|
||||
}
|
||||
b.End();
|
||||
if (_web3Tab == Web3Tab.Mining) { ReportPage(b); return; }
|
||||
@@ -306,7 +310,7 @@ namespace Decentralized
|
||||
if (t == BlackTab.Desk && !desk) continue;
|
||||
var tab = t;
|
||||
string name = L.T("black.sub." + t.ToString().ToLowerInvariant());
|
||||
b.AddButton(tab == _blackTab ? $"[{name}]" : name, () => { _blackTab = tab; _message = null; Open(); });
|
||||
b.AddButton(tab == _blackTab ? $"[{name}]" : name, () => { _blackTab = tab; _message = null; _pay = null; Open(); });
|
||||
}
|
||||
b.End();
|
||||
if (d.Black.Closed(day)) { b.AddLabel(L.T("black.rugged", d.Black.ClosedUntil - day + 1)); return; }
|
||||
@@ -340,7 +344,7 @@ namespace Decentralized
|
||||
GoodHead(c, g, L.T("black.stock", offer.Qty));
|
||||
c.AddLabel(L.T("black.price", offer.Price));
|
||||
c.AddFlexibleSpace();
|
||||
c.AddButton(L.T("black.buy"), () => BuyOffer(offer));
|
||||
c.AddButton(L.T("black.buy"), () => BeginPay(d.Address("platform"), ItemName(offer.Item), offer.Price, () => BuyOffer(offer)));
|
||||
});
|
||||
}
|
||||
else MerchantShelf(b, d);
|
||||
@@ -362,7 +366,7 @@ namespace Decentralized
|
||||
}
|
||||
b.End();
|
||||
b.AddLabel(L.T("mixer.balance", _payAsset, Fmt.Num(d.Hot.Avail(_payAsset))) + " " + L.T("black.sell.rating", d.Black.Rating) + " " + L.T("black.sell.slots", d.Black.ActiveListings, Tuning.BmMaxListings));
|
||||
b.AddButton(L.T("black.sell.all"), ListAll);
|
||||
b.AddButton(L.T("black.sell.all"), () => BeginPay(d.Address("platform"), L.T("black.sell.all") + L.T("pay.listfee"), BlackDelivery.Sellable().Sum(it => BlackMarket.ListFee(BlackMarket.ListPriceOf(BlackDelivery.RefValue(it), _sellMult))), ListAll));
|
||||
b.AddSeparator();
|
||||
var items = BlackDelivery.Sellable();
|
||||
if (items.Count == 0) { b.AddLabel(L.T("black.sell.none")); return; }
|
||||
@@ -380,7 +384,7 @@ namespace Decentralized
|
||||
GoodHead(c, g, "");
|
||||
c.AddLabel(L.T("black.price", g.Price));
|
||||
c.AddFlexibleSpace();
|
||||
c.AddButton(L.T("black.sell.list"), () => ListItem(it));
|
||||
c.AddButton(L.T("black.sell.list"), () => BeginPay(d.Address("platform"), ItemName(g.Item) + L.T("pay.listfee"), BlackMarket.ListFee(g.Price), () => ListItem(it)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -461,7 +465,7 @@ namespace Decentralized
|
||||
c.AddLabel(L.T("black.price", BlackMarket.Pay(BlackMarket.OrderTotal(listing.Price, count), _mode)) + (count > 1 ? " ×" + count : ""));
|
||||
c.AddFlexibleSpace();
|
||||
bool ok = _mode == PayMode.Escrow || seller.Advance;
|
||||
c.AddButton(ok ? L.T("black.order") : L.T("black.noadvance"), () => { if (ok) PlaceOrder(listing, count); });
|
||||
c.AddButton(ok ? L.T("black.order") : L.T("black.noadvance"), () => { if (ok) BeginPay(seller.Name, ItemName(listing.Item) + (count > 1 ? " ×" + count : ""), BlackMarket.Pay(BlackMarket.OrderTotal(listing.Price, count), _mode), () => PlaceOrder(listing, count)); });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -496,6 +500,35 @@ namespace Decentralized
|
||||
|
||||
private static string ItemName(string id) => BlackDelivery.ItemName(id);
|
||||
|
||||
private static void BeginPay(string address, string summary, int total, Action execute)
|
||||
{
|
||||
_pay = new PendingPay { Address = address, Summary = summary, Total = total, Execute = execute };
|
||||
_addr = "";
|
||||
_message = null;
|
||||
Open();
|
||||
}
|
||||
|
||||
/// <summary>付款确认:手输收款地址才放款,输错不付。</summary>
|
||||
private static void PayPage(CustomUIBuilder b)
|
||||
{
|
||||
var p = _pay;
|
||||
b.AddHeader(L.T("black.pay.confirm"));
|
||||
b.AddLabel(L.T("black.pay.item", p.Summary, p.Total));
|
||||
b.AddLabel(L.T("black.pay.to", p.Address));
|
||||
b.BeginPanel(RightW, -1f, TextAnchor.MiddleCenter, 0f, 0f);
|
||||
b.AddInput(L.T("black.pay.input"), _addr, s => _addr = s, "addr", s => _addr = s);
|
||||
b.End();
|
||||
b.BeginRow();
|
||||
b.AddButton(L.T("black.pay.go"), () =>
|
||||
{
|
||||
if (!string.Equals((_addr ?? "").Trim(), p.Address, StringComparison.OrdinalIgnoreCase)) { _message = L.T("black.pay.bad"); Open(); return; }
|
||||
_pay = null;
|
||||
p.Execute();
|
||||
});
|
||||
b.AddButton(L.T("black.pay.cancel"), () => { _pay = null; _message = null; Open(); });
|
||||
b.End();
|
||||
}
|
||||
|
||||
private static void BuyOffer(BmOffer o)
|
||||
{
|
||||
var d = Session.Data;
|
||||
@@ -579,7 +612,7 @@ namespace Decentralized
|
||||
r.End();
|
||||
r.AddLabel(_deskIn ? L.T("mixer.balance", _deskAsset, Fmt.Num(w.Avail(_deskAsset))) : L.T("mixer.balance", Assets.Ponero, Fmt.Num(w.Avail(Assets.Ponero))));
|
||||
AmountRow(r);
|
||||
r.AddButton(L.T("black.desk.go"), DeskSwap);
|
||||
r.AddButton(L.T("black.desk.go"), () => { if (!ReadAmount(out double dv)) return; BeginPay(d.Address("desk"), L.T("pay.swap", Fmt.Num(dv), _deskIn ? _deskAsset : Assets.Ponero), (int)Math.Round(dv * Session.Price(_deskIn ? _deskAsset : Assets.Ponero)), DeskSwap); });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -648,7 +681,7 @@ namespace Decentralized
|
||||
double rate = Mixer.RoundRate(v * Session.Price(_mixAsset));
|
||||
r.AddLabel(L.T("mixer.preview", Fmt.Num(v * Math.Pow(1 - Tuning.MixerFee, _mixRounds)), _mixAsset, (int)Math.Round((1 - Math.Pow(1 - rate, _mixRounds)) * 100), day + _mixRounds));
|
||||
}
|
||||
r.AddButton(L.T("mixer.go"), MixDeposit);
|
||||
r.AddButton(L.T("mixer.go"), () => { if (!ReadAmount(out double mv)) return; BeginPay(d.Address("mixer"), L.T("pay.mix", Fmt.Num(mv), _mixAsset), (int)Math.Round(mv * Session.Price(_mixAsset)), MixDeposit); });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user